Skip to content

Instantly share code, notes, and snippets.

@honmaple
Created September 23, 2016 01:11
Show Gist options
  • Save honmaple/458fcf2abc5831cbcdb2ecd0de6cf29e to your computer and use it in GitHub Desktop.
Save honmaple/458fcf2abc5831cbcdb2ecd0de6cf29e to your computer and use it in GitHub Desktop.
得到当天零点时间
today = datetime.datetime.today()
b = datetime.datetime(today.year, today.month, today.day, 0, 0, 0)
print(b)
now = time.time()
midnight = now - (now % 86400) + time.timezone
itime = time.ctime(midnight)
print(itime)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment