python的datetime转换为unix时间戳
将python的datetime转换为unix时间戳
import time import datetime dtime = datetime.datetime.now() ans_time = time.mktime(dtime.timetuple())
将unix时间戳转换为python的datetime
import datetime unix_ts = 1439111214.0 time = datetime.datetime.fromtimestamp(unix_ts)
将python的datetime转换为unix时间戳
将unix时间戳转换为python的datetime