Question

I am storing a time field in a timestamp without timezone column. The data is stored in UTC time. When I call the data back on heroku I get somehting like 2013-07-13T18:06:41.000Z which is what I want.

However, on my test machine, which is running windows 8 and postgres 9.3 I get this back Sat Jul 13 2013 18:06:41 GMT-0400 (Eastern Daylight Time). This is the right time sort of. It is the correct time with the offset to local time.

How can I match my production db to return the same or similar results to my test db?

Was it helpful?

Solution

It sounds like you want to run your test server with TimeZone set to UTC.

You can set this globally in postgresql.conf, or on a per-user, per-database, per-session or per-transaction basis.

See the manual.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top