Search Postgresql Archives

TIMESTAMP WITHOUT TIME ZONE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am stuck, I am getting two different times from the database depending on the timezone of the system I am querying from.

The story is this:
I have a table name request. It has a column create_dt of type TIMESTAMP WITHOUT TIME ZONE.

When I query this from jdbc into a java.sql.Timestamp and out put it like this

  java.sql.Timestamp ts= rs.getTimestamp(1);
  System.out.println(ts.getTime());

I get different result if I query it from my workstation(US/Easter timezone) and from the server (GMT timezone).

How can this be?? Please help!

A data type of timestamp without time zone should not do any conversions. The java.sql.Timestamp does not store any timezone info, just nano seconds from a date. Some where there is a timezone conversion happening. Why and how do I prevent it?

My idea is this:
What I save to the database (date & time) should be what I get back no matter what timezone I save or retrieve it in.

Randy




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux