-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify datetime strings to ISO format. #10
Comments
If you need humanized/localized output then you might want to use babel and pytz. I used to do something like the following
Then I can get output any way I like e.g.
Or a template filter e.g. https://docs.djangoproject.com/en/dev/ref/contrib/humanize/#naturaltime |
Oh sure. I think my task description was lacking the context. When I said django printing out, I meant Django serialising the DateTime fields. So, we use django-rest framework. Apparently, you can control it over a settings, like https://www.django-rest-framework.org/api-guide/fields/#datetimefield and this should help us, I guess. The strings are for the clients on the response, for eg: the |
Django prints out weird stuff to the frontend, like
"2020-04-04T11:17:37.784674Z",
Lets push it to ISO format"2019-09-27T11:01:41.928158+00:00",
The text was updated successfully, but these errors were encountered: