Skip to content

Instantly share code, notes, and snippets.

@forAllBright
Last active November 17, 2018 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forAllBright/ba2b18acc6929420f05b057178dea20f to your computer and use it in GitHub Desktop.
Save forAllBright/ba2b18acc6929420f05b057178dea20f to your computer and use it in GitHub Desktop.
Python时间类型 #Python #TimeType
#时间转为时间戳
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