How do you print dates in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do you print dates in python?

26th Oct 2022, 3:05 PM
Muhtasim
3 Answers
+ 7
Muhtasim , here is a short tutorial how to use date information in python: using date and time information in python is handled like this: > import datetime as shown in the code > create a datetime object by reading a string that will be parsed by .strptime() > then you can output the information from the datetime object using .strftime() >> for both of the mentioned methods we need format codes: #you can find the format codes here: #https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes https://code.sololearn.com/cQa64lBDQjL2/?ref=app
27th Oct 2022, 2:28 PM
Lothar
Lothar - avatar
26th Oct 2022, 3:26 PM
Jayakrishna 🇮🇳
+ 1
print('🌴🌴🌴')
26th Oct 2022, 6:34 PM
Tibor Santa
Tibor Santa - avatar