Answers for "get hour and minut and second in python"

3

python datetime now only hour and minute

from datetime import datetime
hour_and_minute = datetime.now().strftime("%H:%M")
# "14:09"
Posted by: Guest on March-19-2021
0

real hour in python

import datetime
now = datetime.datetime.now()
print(now.year, now.month, now.day, now.hour, now.minute, now.second)
# 2015 5 6 8 53 40
Posted by: Guest on November-15-2021

Code answers related to "get hour and minut and second in python"

Python Answers by Framework

Browse Popular Code Answers by Language