Converting strings to dates

Kartic kartic.krishnamurthy at gmail.com
Fri Feb 4 13:32:03 EST 2005


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?




More information about the Python-list mailing list