各种乱七八糟的东西

  1.时间处理相关

  

import datetime

# 获取当前时间
 now = datetime.datetime.now()
# 获取今天零点
zeroToday = now - datetime.timedelta(hours=now.hour, minutes=now.minute, seconds=now.second,microseconds=now.microsecond)
 #  获取23:59:59
 lastToday = zeroToday + datetime.timedelta(hours=23, minutes=59, seconds=59)
 print(lastToday)   #2018-10-15 23:59:59

 

posted @ 2018-10-19 15:11  一抹浅笑  阅读(93)  评论(0编辑  收藏  举报