Re: Timestamp problem
От | Oliver Jowett |
---|---|
Тема | Re: Timestamp problem |
Дата | |
Msg-id | 477D2E40.4020105@opencloud.com обсуждение исходный текст |
Ответ на | Timestamp problem (Peter Eisentraut <peter_e@gmx.net>) |
Ответы |
Re: Timestamp problem
|
Список | pgsql-jdbc |
Peter Eisentraut wrote: > Note, > however, that this application does not use time zones or time-zone aware > data types at all. It merely wishes to store '2007-03-25 02:30:00' and > retrieve it in identical form. getTimestamp() must convert the retrieved timestamp to *some* timezone since Timestamp is only meaningful in a particular timezone. If you don't pass an explicit Calendar, it uses the default JVM timezone. If you want to avoid DST and similar you should explicitly pass a Calendar object to Timestamp for a timezone that does not use daylight savings (e.g. UTC) and use the same timezone to interpret the Timestamp. The internal representation of java.sql.Timestamp (which is out our control) is seconds-since-epoch, so you simply can't represent all possible times-without-timezone if you interpret that using rules from a timezone with daylight savings. In your case there is no possible seconds-since-epoch value that will represent '2007-03-25 02:30:00' in your default timezone. -O
В списке pgsql-jdbc по дате отправления: