Re: A problem with Time

2007-08-19 Thread Dick Moores
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

Re: A problem with Time

2007-08-16 Thread Roger Miller
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

Re: A problem with Time

2007-08-16 Thread MRAB
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

Re: A problem with Time

2007-08-16 Thread BartlebyScrivener
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_

Re: A problem with Time

2007-08-16 Thread Gary Herron
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

Re: A problem with Time

2007-08-16 Thread Neil Cerutti
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.

Re: A problem with Time

2007-08-16 Thread Diez B. Roggisch
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

Re: A problem with Time

2007-08-16 Thread syndrowm
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.

Re: A problem with Time

2007-08-16 Thread Shawn Milochik
import time oneDay = 60 * 60 * 24 #seconds in one day date = time.time() yesterday = date - oneDay -- http://mail.python.org/mailman/listinfo/python-list