Python字符串转化为时间

Python字符串转化为时间

import timeimport datetimedef string2datetime(day, method=datetime.datetime, format='%Y-%m-%d %H:%M:%S'):    return method.fromtimestamp(time.mktime(time.strptime(day, format)))string2datetime('2013-12-12',datetime.date, '%Y-%m-%d')
Python字符串转化为时间

相关文章:

你感兴趣的文章:

标签云: