python日期操作

 

from datetime import datetime,date

dayOfWeek = datetime.now().weekday()
print dayOfWeek

******************************************************************

import time
import datetime

dtime = datetime.datetime.now()
ans_time = time.mktime(dtime.timetuple())
unix_ts = 1439111214.0
time = datetime.datetime.fromtimestamp(unix_ts)

作者: hqiang1984

量化自我,极简主义