Having a hard time understanding time zone

Поиск
Список
Период
Сортировка
От Robert DiFalco
Тема Having a hard time understanding time zone
Дата
Msg-id CAAXGW-yLEavhB-Asex8_KEutgEHH5zPMEksgOF0JPieQrTXrWA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Having a hard time understanding time zone
Re: Having a hard time understanding time zone
Список pgsql-jdbc
Does the JDBC driver set the timezone to the origin timezone for each statement?

I have a date column in a table. My Postgres server is running in UTC. My java app is running in "America/Los_Angeles".

I would expect a DEFAULT column of NOW() to insert the current UTC time. While if I specify the time with new Date() from Java I would expect the Java timezone. 

But oddly both set the date field to the localized time in Java and not the UTC time.

This makes me think that the driver is somehow forcing the session timezone.

If so is there any way to make the driver communicate with the server in UTC?

Thanks!

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Tomonari Katsumata
Дата:
Сообщение: Re: About binaryTransfer.
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: Having a hard time understanding time zone