So I am trying to filter django models by date. Using either only the year, year+month, or year+month+day_of_month. The strategy I am using now is this:
n.filter(create_date__year=q)
n.filter(create_date__year=q[:4],create_date__month=q[4:6])
n.filter(create_date__year=q[:4],create_date__month=q[4:6],create_date__day=q[6:8])
Where 'q' is a date string in the format of either either 'yyyy', 'yyyymm' or 'yyyymmdd' respectively.
This is working pretty well but django is not taking into account timezone. Django searches based on the UTC times and not the EDT, which is what the actual datetime object is set to.
Is there a way to search the year/month/day of month based on a specific timezone?