Answers for "python date to seconds"

1

python datetime milliseconds

from datetime import datetime

print(datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3])
Posted by: Guest on April-22-2020
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

Python Answers by Framework

Browse Popular Code Answers by Language