#29600 closed Cleanup/optimization (fixed)
Remove usage of django.utils.datetime_safe where possible
Reported by: | Tim Graham | Owned by: | Tim Graham |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
django.utils.datetime_safe
was added in #1443 to overcome limitations in Python 2.7 where strftime()
doesn't support dates with year < 1900. That issue is fixed in Python 3, but an issue remains where the result of strftime('%Y')
isn't consistent across all platforms. That issue was worked around in #12524.
strftime()
and datetime_safe
are no longer used in the JSON serializer as of 9b1cb755a28f020e27d4268c214b25315d4de42e but the fix from 03924929ba212368240bd7a26b14208fba965cb9 may still be useful in the other places that datetime_safe
is used.
If we remove dateteime_safe
usage in migrations (its need there is questionable, I think), that would fix #29595.
Change History (8)
comment:1 by , 6 years ago
Description: | modified (diff) |
---|
comment:2 by , 6 years ago
comment:6 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I audited all usage of datetime_safe
and added tests or removed usage as appropriate.
In 2ac7cd5: