jugglingdb/postgres-adapter — pull request #29 by scottnonnenberg (2013-09-23 17:22:18+00:00)
Title: Fix: heterogeneous and non-UTC time zones

Yep, the timezone-related changes in my last pull request were incomplete. This completes the job.

There are three different timezone-related situations:

1. The timezones between client and server at the same, and are UTC. That works in master right now.
2. The timezones are the same, but they are not UTC. That worked with the last pull request, but is failing now.
3. The timezones are different. The additional changes in this pull request handle that. I've tested with GMT client and server, PDT client and server, GMT server and PDT client, as well as a smattering of other combinations. The key is to make the server think about time zones.

Basically, we use "WITH TIME ZONE" for our timestamp columns in postgres because that forces postgres to include timezone info when it returns those dates to us. That ensures that the dates are correct when we parse them out. This stackoverflow answer sums it up nicely: http://stackoverflow.com/a/17562423