This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-14
Channels
- # aleph (3)
- # announcements (16)
- # aws (6)
- # babashka (10)
- # beginners (28)
- # cider (1)
- # clj-kondo (14)
- # cljdoc (2)
- # cljs-dev (27)
- # cljsrn (7)
- # clojure (78)
- # clojure-europe (2)
- # clojurescript (13)
- # conjure (6)
- # core-async (2)
- # fulcro (5)
- # helix (7)
- # jobs (1)
- # lgbtq (1)
- # malli (12)
- # missionary (1)
- # nbb (10)
- # pathom (1)
- # portal (12)
- # protojure (1)
- # re-frame (41)
- # react (2)
- # reitit (1)
- # reveal (1)
- # shadow-cljs (72)
- # sql (11)
- # tools-deps (8)
- # vim (1)
- # xtdb (4)
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
: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'...
(! 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=>
@U051B9FU1 ☝️:skin-tone-2:
clj just calls java, there is no special handling here