Fork me on GitHub
#sql
<
2023-01-31
>
J16:01:51

Hi guys! Postgresql question. I have a table with date timestamp fields. I use next-jdbc and honeysqlto deal with postgres (wonderfull libs by the way). I use next.jdbc.date-time to convert java.time.Instant date. When I insert a date with (instant/now) , I get a utc date when I query the table in clojure. When I use the psql cli and do a select my_date_field, the date is displayed with a one extra hour (like my current local date). I check the show timezoneand it’s on Etc/UCT. What param I miss to display the real date in psql?

seancorfield17:01:00

Where are you running psql compared to where your Clojure code is running?

J17:01:51

In a container on a lima virtual machine on my machine.

lukasz17:01:04

Check your JVM processes timezone and/or also set it to UTC

seancorfield17:01:13

Everything needs to be set to UTC to avoid timezone/daylight-savings shifts.

J19:01:51

Thanks guys! It works!