Open
Description
LinkedTZDateTimeField.pre_save
calls _convert_value
which calls _get_populate_from
which does self.timezone = tz
. Now the timezone used to save the instance is stored "statically" in the field.
Reading records from the database uses:
def to_python(self, value):
"""Convert the value to the appropriate timezone."""
# pylint: disable=newstyle
value = super(LinkedTZDateTimeField, self).to_python(value)
if not value:
return value
return value.astimezone(self.timezone) # 👈
So the timezone of the last saved instance is applied to all read instances, even if they may have other timezones.
Activity
pjrulez commentedon Nov 3, 2024
Is there an alternative maintained package?