My Django app receives POST
API request with one of fields in body containing aware timestamp. If I log it's value right after deserialization I'm seeing the same time stamp but in different timezone.
Here's example of submitted request body:
{
"event_timestamp": "2019-11-08T15:00:00+02:00",
...
}
Yet if I try to log the value of this field right after it passes deserialization I'm seeing:
> print(validated_data['event_timestamp'])
2019-11-08 14:00:00+01:00
TZ
is enabled and configurred to CEST time zone:
USE_TZ = True
TIME_ZONE = 'Europe/Vienna'
I could make an assumption that Django is automatically converting received timestamp into defined timezone for entire project, but the result of such a conversion would have given me the same result:
2019-11-08T15:00:00+02:00 represented as CEST timezone is 2019-11-08T15:00:00+02:00
But instead I'm seeing conversion to 2019-11-08 14:00:00+01:00
which is time zone for London.
I understand that such conversions are normal process of Django handling aware datetime objects, but why does it convert received value to timezone that is neither set as default for the project itself nor has any relation to received timestamp?
Is there a way of managing default way of such convertions to timezone I manually define in settings.py
or disable them all together?