Last active
March 11, 2016 08:05
-
-
Save MOOOWOOO/7a73c2255d39c11a51d1 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 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