Code

Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#20969 closed Bug (invalid)

ValuesQuerySet converts datetimes to UTC

Reported by: jhatch28@… Owned by: nobody
Component: Database layer (models, ORM) Version: 1.4
Severity: Normal Keywords: valuesqueryset datetime
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

According to comment #9619, django doesn't touch the raw data coming from the database. Postgresql returns the datetimes offset to local time as timezone aware to the local offset. However, in contrast to #9619, django gives the datetimes a UTC timezone, and offsets them back to UTC time.

Attachments (0)

Change History (1)

comment:1 Changed 8 months ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

The comments in this tracker aren't normative. Specifically the comments on #9619 predate the timezone support that was introduced in Django 1.4.

You're seeing the expected behavior when settings.USE_TZ = True. Django doesn't offset back to UTC, it gets the values directly in UTC.

Please reopen if you think that Django's behavior is wrong or inconsistent with the documentation.

Last edited 8 months ago by aaugustin (previous) (diff)

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.