#24281: auto_now & auto_now_add ignore TIME_ZONE / USE_TZ settings for DateField -------------------------------------+------------------------------------- Reporter: djbug | Owner: nobody Type: Bug | Status: new Component: | Version: master Internationalization | Severity: Normal | Resolution: Keywords: timezone | Triage Stage: | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by carljm): Replying to [comment:5 aaugustin]: > That said, until now `DateField` was safe from timezone-related issues. With that change, saving an object with `auto_now` or `auto_now_add` during the autumn DST change will raise an exception, because the datetime is ambiguous, even though the date isn't ambiguous. Of course, because we know that the date is not in fact ambiguous during a transition regardless of whether you force DST or no-DST, I think this would be a case where it would be safe to simply pass `is_dst=False` to the conversion and avoid the risk of exception. > My inclination would be to document the current behavior, in order to avoid a backwards-incompatible change, and recommend using [https://docs.djangoproject.com/en/1.7/ref/models/fields/#default Field.default] instead. But I am OK with this solution. If you actually care about timezones, I think you are probably better off in control of an explicit default. -- Ticket URL: <https://code.djangoproject.com/ticket/24281#comment:7> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/063.ab1d81f1673de748ad998c670b9c221c%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.