#27306: Document relation between auto_now/auto_now_add and timezones
-------------------------------------+-------------------------------------
     Reporter:  Baptiste Mispelon    |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Documentation        |                  Version:  1.10
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Baptiste Mispelon):

 Here's how our date/time-related fields handle `auto_now*`:

 * `DateField` uses `datetime.date.today()`: today's date in the default
 timezone
 * `TimeField` uses `datetime.datetime.now().time()`: the clock time in the
 default timezone
 * `DateTimeField` uses `timezone.now()`: the current datetime in the
 current timezone

 ("current" and "default" timezone are defined here:
 https://docs.djangoproject.com/en/1.10/topics/i18n/timezones/#default-
 time-zone-and-current-time-zone).

 As Aymeric said, there's no bug here so this is only a documentation
 issue: we should clarify what "now" and "today" mean for `auto_now`.

--
Ticket URL: <https://code.djangoproject.com/ticket/27306#comment:2>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.776ae12b2351898d8afe1c7b2901fc66%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to