Answers for "how to add time with time delta in python"

1

how to add time with time delta in python

from datetime import timedelta, datetime
now = datetime.now()
print("Today is:-",now)
print("600 hours later than today will be", str(now + timedelta(hours=600)))
Posted by: Guest on October-03-2021
1

add time delta pytohn

import datetime

ts = ts + datetime.timedelta(seconds=1)
ts = ts + datetime.timedelta(minutes=1)
ts = ts + datetime.timedelta(hours=1)
ts = ts + datetime.timedelta(days=1)
Posted by: Guest on June-26-2020

Python Answers by Framework

Browse Popular Code Answers by Language