Answers for "python datetime get time"

7

oython get time

from datetime import datetime

now = datetime.now()

current_time = now.strftime("%H:%M:%S")
print("Current Time =", current_time)
Posted by: Guest on April-29-2020
0

python print datetime

import datetime
print("Now:", datetime.datetime.now())
Posted by: Guest on August-23-2020
0

get time python

from datetime import datetime

date = datetime.now()
print(date)
# Prints in the format: year, month, day, hour, minute, second and microsecond
Posted by: Guest on February-15-2021

Python Answers by Framework

Browse Popular Code Answers by Language