Re: Converting strings to dates

2005-02-04 Thread Dan Bishop
Chermside, Michael wrote: > I'm trying to convert a string back into a datetime.date. > > First I'll create the string: > > > Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> import time, da

Re: Converting strings to dates

2005-02-04 Thread Kartic
py> import time py> date_str = time.strftime('%Y-%m-%d', time.localtime()) py> date_str '2005-02-04' py> time.strptime(date_str, '%Y-%m-%d') (2005, 2, 4, 0, 0, 0, 4, 35, -1) That work? -- http://mail.python.org/mailman/listinfo/python-list

Converting strings to dates

2005-02-04 Thread Chermside, Michael
I'm trying to convert a string back into a datetime.date. First I'll create the string: Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import time, datetime >>> a_date = datetime.date.today()