Fork me on GitHub
#sql
<
2018-01-15
>
jgh00:01:15

oh there’s also to-sql-date, maybe that’s what i need to use.

jgh00:01:42

nope 😕

jgh00:01:05

problem is there doesnt seem to be a timezone attached to the postgresql date type, just timestamp or time

jgh00:01:49

so i guess maybe it’s the jvm doing this?

jgh00:01:53

what a pain

seancorfield00:01:30

If you have everything on UTC, you're fine. Or else everything on Eastern time. As soon as you have pieces on different timezones, you're sunk.

jgh00:01:24

let’s see what happens when we do :jvm-opts ["-Duser.timezone=UTC"]

jgh00:01:17

that did the trick

jgh00:01:31

why does jvm have its own timezone setting instead of using the machine it’s running on?

seancorfield00:01:35

Like I say everything on UTC.

seancorfield00:01:53

By default, the JVM will use the system timezone, but you can change it.

jgh00:01:34

i see, i wonder why im seeing the same bug on my server…maybe cause im building the image in EST?

jgh00:01:56

thanks for your help btw, i’ll just override everything to utc now.

seancorfield00:01:31

Server has a TZ. Database has a TZ. JVM has a TZ. 🙂

jgh00:01:26

alright, well that fixed it locally but my server is still screwed 😛

jgh00:01:27

the server is UTC and I’m running the jar with the command java -Duser.timezone=UTC -jar service.jar

jgh00:01:51

this might be a docker configuration issue thougg

jgh02:01:48

hrm, nope 😕

jgh03:01:05

ah it’s being stored right but not displayed right

jgh03:01:58

momentjs helped 😛

rymndhng18:01:41

@jgh this is another option at startup of your app:

;; using java.util.TimeZone
(TimeZone/setDefault (TimeZone/getTimeZone "UTC"))

Will23:01:12

I'm new to clojure so this may be a dumb question, but I keep getting this error when trying to query a database

java.lang.IllegalArgumentException: "sql-params" expected vector [sql param*], found clojure.lang.PersistentVector 
I'm using the clojure.java.jdbc library

Will23:01:26

What am I doing wrong?