Answers for "how to print time in python 3"

1

how to print time python 3

import datetime
now = datetime.datetime.now()
print (now.strftime("%Y-%m-%d %H:%M:%S"))
# key: https://strftime.org/
Posted by: Guest on March-17-2020
7

print time python

from datetime import datetime

now = datetime.now().time() # time object

print("now =", now)
print("type(now) =", type(now))
Posted by: Guest on March-22-2020

Python Answers by Framework

Browse Popular Code Answers by Language