audreyfeldroy / audreyfeldroy/standardjson
Factor out and/or remove UTC+0 stripping code
- Dominant language
- Python
- Stars
- 18
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
For datetime and time objects in the UTC+0 timezone, we currently do this:
``` python
if r.endswith('+00:00'):
r = r[:-6] + 'Z'
```
This should either be
- factored out into a separate function
- removed entirely if there's no need to strip this. Arguably it's actually bad to strip it, because UTC+0 timezone != no timezone.
This timezone stripping originally came from core Django (https://github.com/django/django/blob/master/django/core/serializers/json.py#L94-L95). Why does Django does this in the first place? There has to be a reason.
Contributor guide
Research direction
Locate the encoder code containing the shown `r.endswith('+00:00')` branch, then compare its behavior with the linked Django serializer implementation and the UTC semantics described here. Decide whether the `Z` conversion is required, and finish by making the chosen behavior explicit and consistent for datetime and time objects.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100