Skip to content

Instantly share code, notes, and snippets.

@MOOOWOOO
Last active March 11, 2016 08:05
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 MOOOWOOO/7a73c2255d39c11a51d1 to your computer and use it in GitHub Desktop.
Save MOOOWOOO/7a73c2255d39c11a51d1 to your computer and use it in GitHub Desktop.
分:秒.毫秒 的python计算方式
def calculate(last_time, current_time):
time_delta = \
datetime.datetime.strptime(current_time, '%M:%S.%f') -\
datetime.datetime.strptime(last_time, '%M:%S.%f')
return str(time_delta)[2:-4]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment