python 日期字符串转时间戳

pylist 853

python 日期字符转时间戳

>>> import time
>>> import datetime
>>> s = "01/12/2011"
>>> time.mktime(datetime.datetime.strptime(s, "%d/%m/%Y").timetuple())
1322697600.0
登录发表评论