Re: Problem with DATE
От | Vinayak |
---|---|
Тема | Re: Problem with DATE |
Дата | |
Msg-id | 1420614068412-5833152.post@n5.nabble.com обсуждение исходный текст |
Ответ на | Re: Problem with DATE (Lachezar Dobrev <l.dobrev@gmail.com>) |
Список | pgsql-jdbc |
I tried to connect PostgreSQL using the version 2 protocol. but the result showing the timezone part. example: 2014-01-11 +05:30:00 PostgreSQL has TIMESTAMP and TIMESTAMPTZ type but in JAVA there is only setTimestamp() and if we use protocolVersion "2" then the result showing the time zone value. Example: For timestamp(without timezone): java.sql.Timestamp sqlDate = new java.sql.Timestamp(new java.util.Date().getTime()); ps.setTimestamp(5, sqlDate); Result: 2015-01-07 12:18:03.150000 +05:30:00 So I think instead of using protocolVersion "2" its better to typecast the argument. ----- Regards, Vinayak, -- View this message in context: http://postgresql.nabble.com/Problem-with-DATE-tp5833008p5833152.html Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.
В списке pgsql-jdbc по дате отправления: