Fork me on GitHub
#tools-deps
<
2021-08-14
>
henryw37410:08:19

I want to change the default timezone in my jvm. In the past, with lein, I think I just set the user.timezone property. with clj, if I haven't set it myself, I find that property is already set, in my case to Europe/London. If I do try setting it with :jvm-opts ["-Duser.timezone=\"America/New_York\""] I find that prop is set to "GMT+01:00" , via (System/getProperty "user.timezone") . If I run a java main, ie no clj, the prop is not set by default. Java 11. anyone got any pointers? Thanks

seancorfield19:08:21

:jvm-opts has to be under an alias -- not at the top level. You can use -J-Duser.timezone=... as a command-line argument to clj` tho'...

seancorfield19:08:22

(! 1427)-> clj
Clojure 1.10.3
user=> (System/getProperty "user.timezone")
"America/Los_Angeles"
user=> ^D
(! 1428)-> clj -J-Duser.timezone=America/New_York
Clojure 1.10.3
user=> (System/getProperty "user.timezone")
"America/New_York"
user=> 

seancorfield19:08:53

@U051B9FU1 ☝️:skin-tone-2:

henryw37419:08:48

Thanks I'll have a go

henryw37406:08:05

all good now. you got me on the right path. thanks

Alex Miller (Clojure team)11:08:14

clj just calls java, there is no special handling here

henryw37416:08:07

Hmm. Ok thanks