R
R
ring0za2016-02-01 11:19:56
PostgreSQL
ring0za, 2016-02-01 11:19:56

Why does Postgres add an hour to a date?

From the client I accept the date and time as strings, I glue them together on the server just like I date+" "+time+":00".use jodatime DateTime and this format "dd.MM.YYYY HH:mm:ss"to get a date object. Then I save everything in postgres via eclipse link. A converter to sql.Timestamp has been written for greater convenience.
An example of a received date "2016-02-04 15:30:00"in postgres.
I send it to him "2016-02-04 14:30:00". Because of this, I came to the conclusion that postgres itself increases the date by an hour. The date is stored in timestamp without timezone. jodatime latest version 2.9.2.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2016-02-01
@zolt85

I suspect that the same converter is doing you a disservice. Have you covered it with unit tests? I do not think that PostgreSQL is engaged in amateur activities in this regard.

A
Alexey Sundukov, 2016-02-01
@alekciy

Make a pure SQL query to the database (albeit corny from the CLI) and see the result. Perhaps your TZ connection is set incorrectly. In any case, you need to start with a bare SQL query by hand.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question