Opened 12 years ago

Closed 12 years ago

#20045 closed Uncategorized (invalid)

template timezone datetimefields with auto_now_add, auto_now

Reported by: rpq Owned by: nobody
Component: Template system Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The instructions found at ​https://docs.djangoproject.com/en/1.4/topics/i18n/timezones/#time-zone-aware-output-in-templates indicate that datetime aware fields on a model displayed on a template should automatically display in the current time zone. I use TIME_ZONE set to 'UTC' and change the current time zone with activate() for users in different time zones.

When displaying my DateTimeFields (created_at and updated_at) created with auto_now and auto_now_add, the template displays the datetime fields in UTC regardless of what time zone is set using activate() and localtime filter has no effect on them. All the other DateTimeFields not created with auto_now and auto_now_add are displaying in the template as expected in the current timezone.

Help?

Change History (3)

comment:1 by rpq, 12 years ago

Version: 1.41.5

I should mention that using the timezone filter to force the conversion works on these datetime fields.

comment:2 by rpq, 12 years ago

Please close this as invalid. It turns out user's timezone was not properly set.

comment:3 by rpq, 12 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top