[PDB Tech] Clock skew?
Sander Steffann
sander at steffann.nl
Tue Feb 4 15:50:13 PST 2020
Hi,
> I submitted an issue about this on github, but it was more to do with an inconsistency between using localtime in the local database and UTC coming from PDB. This is not the first time I have encountered timezone related bugs with the Python PDB modules. Which database are you using? Postgres?
Yep. I already traced it and created an issue+PR:
https://github.com/peeringdb/django-peeringdb/issues/38
https://github.com/peeringdb/django-peeringdb/pull/39
This strange situation is cause by Django using TIME_ZONE = 'America/Chicago' by default and the django-peeringdb code running with time zone support off. With PostgreSQL Django always stores a datetime in UTC, and uses the TIME_ZONE setting to convert it. By explicitly setting TIME_ZONE='UTC' in the default Django settings everything makes sense again :)
I strongly feel that TIME_ZONE='UTC' should be the Django default, but apparently it isn't :/
Cheers,
Sander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.peeringdb.com/pipermail/pdb-tech/attachments/20200205/5adc3d01/attachment.sig>
More information about the Pdb-tech
mailing list