Last active
November 17, 2018 06:43
-
-
Save forAllBright/ba2b18acc6929420f05b057178dea20f to your computer and use it in GitHub Desktop.
Python时间类型 #Python #TimeType
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 time_handle(time_in): #time_in is str type | |
d = datetime.datetime.strptime(time_in, "%m/%d/%Y %H:%M:%S") | |
x1 = time.mktime(d.timetuple()) #get the timestamp | |
return x1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment