import datetime import time string转datetime str = '2012-11-19' date_time = datetime.datetime.strptime(str,'%Y-%m-%d') date_time datetime.datetime(2012,11,19,0,0) datetime转string date_time.strftime('%Y-%m-%d') '2012-11-19' datetime转时间戳 time_time = tim…