Created
December 12, 2017 09:54
-
-
Save ResolveWang/9bb648e87eb159b484315a60ec5850de to your computer and use it in GitHub Desktop.
使用python获取当天零点的时间戳
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_zero_timestamp(self): | |
cur_timestamp = time.time() | |
cur_time = time.localtime(cur_timestamp) | |
zero_time_stamp = cur_timestamp - ( | |
cur_time.tm_sec + 60 * cur_time.tm_min + 3600 * cur_time.tm_hour) | |
return zero_time_stamp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment