#34699: Filtering on annotated TruncSecond expression gives unexpected result.
-------------------------------------+-------------------------------------
     Reporter:  Stefan               |                    Owner:  Francesco
         Type:                       |  Panico
  Cleanup/optimization               |                   Status:  assigned
    Component:  Database layer       |                  Version:  4.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

 It works as documented:
 - `timezone.now()` - ''"If USE_TZ is True, this will be an aware datetime
 representing the **current time in UTC**. Note that now() will always
 return times in UTC regardless of the value of TIME_ZONE; you can use
 localtime() to get the time in the current time zone."''
 - `Trunc()` - ''"If a different timezone like Australia/Melbourne is
 active in Django, then the datetime **is converted to the new timezone**
 before the value is truncated."''

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34699#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018963b6b015-81d487f6-48d9-4507-a9de-d502e0f79841-000000%40eu-central-1.amazonses.com.

Reply via email to