#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.