Answers for "can datetime create time with seconds in python"

1

add seconds to datetime python

from datetime import datetime, timedelta
x = datetime.now() + timedelta(seconds=3)
x += timedelta(seconds=3)
Posted by: Guest on June-20-2021
1

python datetime to seconds

from datetime import datetime
dt = datetime.today()  # Get timezone naive now
seconds = dt.timestamp()
Posted by: Guest on April-07-2021

Code answers related to "can datetime create time with seconds in python"

Python Answers by Framework

Browse Popular Code Answers by Language