Answers for "how to get current time in hours and minutes in python"

9

python get current hour

import datetime
now = datetime.datetime.now()
print(now.year, now.month, now.day, now.hour, now.minute, now.second)
Posted by: Guest on May-12-2020
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 "how to get current time in hours and minutes in python"

Python Answers by Framework

Browse Popular Code Answers by Language