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

Attachment: signature.asc
Description: Message signed with OpenPGP

_______________________________________________
Pdb-tech mailing list
[email protected]
https://lists.peeringdb.com/cgi-bin/mailman/listinfo/pdb-tech

Reply via email to