I have a DateField in django whose default value is set to timezone.now
How can I get the week of the day. I mean the day is either sunday or monday or other ??
I have a DateField in django whose default value is set to timezone.now
How can I get the week of the day. I mean the day is either sunday or monday or other ??
A Django DateField is
represented in Python by a
datetime.dateinstance
So in Python code you can use date.weekday() or date.isoweekday() on it.
In a template you should use the date filter, e.g.
Today is {{ date_variable|date:"l" }}