Re: Noob | datetime question

2006-11-14 Thread [EMAIL PROTECTED]
On Nov 14, 4:22 pm, "Demel, Jeff" <[EMAIL PROTECTED]> wrote: > I'm having trouble finding exactly what I need by googling, so thought > I'd try to get a quick answer from the group. This seems like something > that should be dead simple. > > I need to generate a string value of a date in the for

Re: Noob | datetime question

2006-11-14 Thread Carsten Haese
On Tue, 2006-11-14 at 09:33 -0600, Kevin Kelley wrote: > import time > FORMAT='%Y%m%d' > > time.strftime(FORMAT,time.gmtime(time.time()+8380800)) > output = '20070219' While the above works, the following variation using datetime is more readable: >>> import datetime >>> someday = datetime.date.

RE: Noob | datetime question

2006-11-14 Thread Demel, Jeff
Perfect. Thanks a million. .strftime was the method I was looking for. -Jeff -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kevin Kelley Sent: Tuesday, November 14, 2006 9:34 AM To: python-list@python.org Subject: Re: Noob | datetime question

Re: Noob | datetime question

2006-11-14 Thread Kevin Kelley
import timeFORMAT='%Y%m%d'time.strftime(FORMAT,time.gmtime(time.time()+8380800))output = '20070219'--Kevin KelleyOn 11/14/06, Demel, Jeff <[EMAIL PROTECTED]> wrote: I'm having trouble finding exactly what I need by googling, so thoughtI'd try to get a quick answer from the group.  This seems like