Answers for "how to get current time in 12 hour format using pytohn"

0

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

python datetime into 12-hour format

d.strftime("%I:%M")
Posted by: Guest on July-27-2021

Code answers related to "how to get current time in 12 hour format using pytohn"

Python Answers by Framework

Browse Popular Code Answers by Language