191k views
1 vote
What is returned by datetime(1970, 1, 1).strftime('%Y-%d-%B') in Python?​

1 Answer

5 votes

Answer:

1970-01-January

Step-by-step explanation:

In Python, there is a datetime module to enable us to work with dates. We can give three inputs (year, month and day) to datetime class constructor. This will create a date object with a specific year, month and day. The strftime is a method that can format the date object into readable strings. We can set a format (e.g. %Y-%d-%B) in the strftime method and it will display the date in the format of year-day-name of month. If the month from the date object is 1, then the name of month is January.

User Mathilde
by
5.4k points