import datetime,time stringDate = "2006-05-18 19:35:00" dt = datetime.datetime.fromtimestamp(time.mktime(time.strptime(stringDate,"%Y-%m-%d %H:%M:%S"))) print dt 2006-05-18 19:35:00 >>> print type(dt) <type ‘datetime.datetime‘> >>>
http://www.sharejs.com/codes/python/835
时间: 2024-10-24 09:57:37