#29861: Using timezone.now() instead of datetime.now() on class TimeField
-------------------------------------+-------------------------------------
Reporter: italomg | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database | Version: 2.1
layer (models, ORM) | Keywords: timezone;
Severity: Normal | TimeField; DateTimeField
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
On jango db model Class ''DateTimeField'' when using arguments like
`auto_now*` the time will be set on that field value using
`timezone.now()`.
While its sibling class ''TimeField' uses `datetime.datetime.now()` to
set the value.
Maybe it makes more sense to just use `timezone.now()` in both places.
--
Ticket URL: <https://code.djangoproject.com/ticket/29861>
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/050.0e1094b5c72a97138a8093d27c505928%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.