At 08:30 AM 8/16/2007, special_dragonfly wrote:
>Hello,
>
>I need to return the date yesterday in the form DDMM. I looked through
>the modules: time, datetime and calendar but can't find anything that leaps
>out at me.
>
>The problem I'm having is that although I can use time.localtime and get
On Aug 16, 9:46 am, MRAB <[EMAIL PROTECTED]> wrote:
>
> As well as the other replies, this also works (as far as I can tell!):
>
> import time
> today = time.localtime()
> yesterday = today[ : 2] + (today[2] - 1, ) + today[3 : ]
> yesterday = time.localtime(time.mktime(yesterday))
This is somethin
On Aug 16, 4:30 pm, "special_dragonfly" <[EMAIL PROTECTED]>
wrote:
> Hello,
>
> I need to return the date yesterday in the form DDMM. I looked through
> the modules: time, datetime and calendar but can't find anything that leaps
> out at me.
>
> The problem I'm having is that although I can use
On Aug 16, 10:54 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> RTFM is the answer...
I don't know. I remember scratching my head for a day or two over the
module explanations and instructions until I found a little howto with
a lot of explicite examples.
http://pleac.sourceforge.net/pleac_
special_dragonfly wrote:
> Hello,
>
> I need to return the date yesterday in the form DDMM. I looked through
> the modules: time, datetime and calendar but can't find anything that leaps
> out at me.
>
> The problem I'm having is that although I can use time.localtime and get a
> tuple of th
On 2007-08-16, Shawn Milochik <[EMAIL PROTECTED]> wrote:
> import time
>
>
> oneDay = 60 * 60 * 24 #seconds in one day
>
> date = time.time()
>
> yesterday = date - oneDay
Or use a timedelta.
>>> import datetime
>>> yesterday = datetime.datetime.today() - datetime.timedelta(days=1)
>>> yesterday.
special_dragonfly schrieb:
> Hello,
>
> I need to return the date yesterday in the form DDMM. I looked through
> the modules: time, datetime and calendar but can't find anything that leaps
> out at me.
>
> The problem I'm having is that although I can use time.localtime and get a
> tuple o
On 8/16/07, special_dragonfly <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I need to return the date yesterday in the form DDMM. I looked through
> the modules: time, datetime and calendar but can't find anything that
> leaps
> out at me.
>
> The problem I'm having is that although I can use time.
import time
oneDay = 60 * 60 * 24 #seconds in one day
date = time.time()
yesterday = date - oneDay
--
http://mail.python.org/mailman/listinfo/python-list