1. timestamp => 固定格式 ts = 1544704784 time.strftime("%Y-%m-%d %H:%M:%S",time.localtime(ts)) 2. 通过replace 来求某时刻的timestamp now = datetime.datetime.now() earlymon = now.replace(day=1, hour=0, minute=0, second=0) earlymonts = int(time.mktime(earlymon.timetuple()))
3. 未完待续 ...