1 2 3 4 5 6 7 8 9 10 11 | from mx.DateTime import *
from datetime import datetime
date = now()
month_ids = []
while not (date.month == 4 and date.year == 2004):
month_ids.append((date.strftime('%b%y'),date.strftime('%B %Y')))
date = date + RelativeDateTime(months=-1)
print month_ids
#date.days_in_month
|
More like this
- Handling choices the right way by mallipeddi 4 years, 3 months ago
- Model field choices as a namedtuple by whiteinge 10 months, 2 weeks ago
- In page edit object links by punteney 3 years, 10 months ago
- SelectDateWidget with format: day, month, year by zenx 2 years, 1 month ago
- DropDownMultiple widget by marinho 3 years, 9 months ago
Comments