pq: datetime field is not returning UTC
For a table like:
CREATE TABLE times (
typeId bigint,
datetime timestamp without time zone
);
It is not returning the correct datetime:
input: &{0 2009-11-10 23:00:00 +0000 UTC}
output: &{0 2009-11-10 23:00:00 +0000 +0000}
Instead of returning UTC, it is adding other “+0000”.
I checked it in the original repository (https://github.com/bmizerany/pq), and it is working ok there.
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 25 (17 by maintainers)
I just solve it; the output is right now:
I edited file ‘/etc/postgresql/9.1/main/postgresql.conf’ to change the value of the key “timezone” to “UTC”:
timezone = 'UTC'Then, I restarted the server:
sudo /etc/init.d/postgresql restartThanks!