I'm using postgresql to store some dates on a database.
In my application it is fundamental that it is completely aware of timezones and I was conducting some basic tests, between, client, server and database.
I'm sending the dates from a browser's application I did in GWT and read the dates on postgresql.
My tests:
The client is always in GMT Timezone, and I'm sending always the same date for each case.
13/04/2012 00:00:00 GMT+00
On posgres I'm changing timezones for each test. Between tests I'm removing all dates from the table.
To change the timezone on the posgres, I do it on the {PostgreSQL HOME}\9.1\data\postgresql.conf setting the timezene to the one I want.
Tests: Client: 13/04/2012 00:00:00 GMT+00
1st test - posgres EST - 12/04/2012 19:00:00-05
According to postgresql documentation EST = GMT - 5
2nd test - posgres GMT + 5 - 12/04/2012 19:00:00-05
3rd test - posgres GMT - 5 - 13/04/2012 05:00:00+05
Now my question rises: According the the docs, EST = GMT - 5. So why am I reading it the other way around? Am I missing something here?
EDIT
Technical aspects of my tests:
On the client I send this: 2012 Apr 13 00:00:00 GMT+00.
On the server I'm using JDBC to write on the db:
convert java.utils.date to
java.sql.timestamp
java.sql.Timestamp sqlTimeStamp = new java.sql.Timestamp(date.getTime());
(date is java.utils.Date that comes from the client)
set the prepared statement
PreparedStatement ps = con.prepareStatement("INSERT INTO teste.dates (dates_tz, dates_ntz) VALUES (?, ?);"
ps.setTimestamp(1, sqlTimeStamp); ...
For the record, this is just something I want to understand, because overall it works well for my purposes..