D
D
dance_and_programmiruy2020-06-06 09:54:58
Python
dance_and_programmiruy, 2020-06-06 09:54:58

How to use Python datetime?

Good afternoon everyone. I wrote a Python script that parses the date in the following format:
1) Today
2) Yesterday
3) June
4 4) June 5,
etc.
How can I display on the screen not the words "today or yesterday", but in the format DD.MM.YYYY?
For yesterday it was 06/05/2020
, etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Kharitonov, 2020-06-06
@dance_and_programmiruy

today = datetime.datetime.today()
data_now=today.strftime("%Y-%m-%d)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question