8
From my understanding this automatically stamps the time considering the correct time zone.
That’s a misunderstanding. See the first sentence of the timezone documentation:
When support for time zones is enabled, Django stores datetime information in UTC in the database, uses time-zone-aware datetime objects internally, and translates them to the end user’s time zone in templates and forms.
As you’ve seen, that UTC datetime can then be converted to whatever you want for display, etc.
1
**in the models import datetime
in settings.py change the USE_TZ to False**
LANGUAGE_CODE = ‘en-us’
TIME_ZONE = ‘UTC’
USE_I18N = True
USE_L10N = True
USE_TZ = False
- [Django]-How to filter objects by price range in Django?
- [Django]-How to return all records but exclude the last item
- [Django]-Is there a way to send a user email when user object is created?
- [Django]-Django signals. how to create a unique dispatch id?
- [Django]-How to modify a models who's already migrated in Database?
- [Django]-Django/Celery can't find importlib
- [Django]-Python range() builtin function, erm… malfunctioning with Django
- [Django]-How do I treat django's TemporaryUploadedFile as a regular python file
- [Django]-Django template for loop iterating two item
Source:stackexchange.com