Answers for "why is datetime printing seconds in python"

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
0

print current time hours and minutes in python

import datetime
currentime = datetime.datetime.now()
time = currentime.strftime('%H:%M')
print(time)
Posted by: Guest on December-08-2021

Code answers related to "why is datetime printing seconds in python"

Python Answers by Framework

Browse Popular Code Answers by Language