Re: converting month string

2010-02-16 Thread fchow
You can use the python time module in the standard library import time month_int = time.strptime(month_str, "%b").tm_mon The %b formatter assumes your month_str is a valid abbreviated month str (e.g. 'apr'). Check the time docs here: http://www.python.org/doc/2.5.2/lib/module-time.html On Feb

converting month string

2010-02-15 Thread harryos
hi In my view I am taking user input string for month( like 'jan','feb') and want to search the db for objects with those months as published time. def entry_archive_for_month(request,year,month): entryset=Entry.objects.filter(pub_time__year=year,pub_time__month=month) obviously this will caus