date.today() will return
if you want to get meaningful string representation use
datetetime.date
object. That's why you get <class 'datetime.date'>
- that's exactly representation of instance of class datetime.date
.if you want to get meaningful string representation use
strftime()
method of datetime.date
objectfrom datetime import date today = date.today() print(today.strftime('%d-%m-%Y')) print(today.strftime('%d-%b-%Y'))
Output:31-01-2019
31-Jan-2019
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs