python calc days between dates
from datetime import date
d0 = date(2008, 8, 18)
d1 = date(2008, 9, 26)
delta = d1 - d0
print(delta.days)
python calc days between dates
from datetime import date
d0 = date(2008, 8, 18)
d1 = date(2008, 9, 26)
delta = d1 - d0
print(delta.days)
seconds to days python
def show_time(time):
time = int(time)
day = time // (24 * 3600)
time = time % (24 * 3600)
hour = time // 3600
time %= 3600
minutes = time // 60
time %= 60
seconds = time
if day != 0:
return "%dD %dH %dM %dS" % (day, hour, minutes, seconds)
elif day == 0 and hour != 0:
return "%dH %dM %dS" % (hour, minutes, seconds)
elif day == 0 and hour == 0 and minutes != 0:
return "%dM %dS" % (minutes, seconds)
else:
return "%dS" % (seconds)
print(show_time(12345))
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us