35👍
✅
http://docs.djangoproject.com/en/dev/ref/models/querysets/#month
You can
>>> import datetime
>>> today = datetime.date.today()
>>> MyModel.objects.filter(mydatefield__year=today.year,
mydatefield__month=today.month)
0👍
That’s if you are only interested in gettting the month:
import datetime
today = datetime.date.today()
months = ['zero','January','February','March','April','May','June','July','August','September','October','November','December']
current_month = months[today.month]
- Run django application without django.contrib.admin
- Google App Engine logs a mess of New connection for … and Client closed local connection on
- Django long request timeout
Source:stackexchange.com