How to get weekday name in locale format from number in Python?
It it other method to get weekday name in Python that setting date to monday and using strftime('%a')
than adding timedelta(day=1)
.
From this answer:
You can use
>>> import calendar
>>> dayoftheweek = 2
>>> calendar.day_name[dayoftheweek]
'Wednesday'
Where Monday = 0, Tuesday = 1
etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With