I'm using django 1.5.1 and I guess in in 1.5, the dates method returns 
datetime objects.  So nevermind!



On Tuesday, October 15, 2013 5:56:01 PM UTC-7, Chad Vernon wrote:
>
> I'm trying to use the dates QuerySet method but I am getting different 
> values in the template:
>
> view:
> timecards = Timecard.objects.all()
> dates = Timecard.objects.dates('date', 'day', order='DESC')
>
>
> template:
> {% for tc in timecards %}
>   {{ tc.date }}
> {% endfor %}
>
> Oct. 14, 2013
>
> {% for d in dates %}
>   {{ d }}
> {% endfor %}
>
> Oct. 13, 2013, 5 p.m.
>
> The documentation says dates is supposed to return a datetime.date object, 
> so there should not be any time.  So where does the 5 p.m. come from?  Also 
> I'm assuming the day difference is due to time zone which comes with time. 
>  So am I using the dates method correctly?
>
> Thanks,
> Chad
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c754f176-5a07-4350-b0fd-08621b4407b5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to