[PDB Tech] Clock skew?

Matt Griswold grizz at 20c.com
Thu Feb 6 07:07:10 PST 2020


On Wed, Feb 05, 2020 at 12:50:13AM +0100, Sander Steffann wrote:
> 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 :/

I agree, we will review. I believe there was a reason that it wasn't set by
default, but I can't remember what it was.

Cheers


More information about the Pdb-tech mailing list