Created
August 10, 2022 13:56
-
-
Save Park-Developer/83e0f6bfd19d255f8c135218720180fc to your computer and use it in GitHub Desktop.
Calculate time
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 calc_timeDelta(reference_time:str,days,hours,minutes,time_format)->str: | |
calced_time=datetime.strptime(reference_time,time_format)+timedelta(days=days,minutes=minutes,hours=hours) | |
return calced_time | |
# test | |
time_format="%Y-%m-%d %H:%M:%S" | |
print(calc_timeDelta(reference_time='2022-08-10 22:10:49',days=-10,hours=21,minutes=3,time_format=time_format)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment