Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
python
from datetime import datetime
time_format = '%H%M'
a_time = '1730'
b_time = '1700'
time_diff = datetime.strptime(a_time,time_format) - datetime.strptime(b_time,time_format)
print(time_diff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment