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?