标签:
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
标签:
原文地址:http://www.cnblogs.com/linbinqiang/p/4919323.html