This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-29
Channels
- # adventofcode (13)
- # announcements (2)
- # asami (59)
- # babashka (6)
- # beginners (273)
- # calva (18)
- # cider (3)
- # cljs-dev (3)
- # clojure (84)
- # clojure-estonia (1)
- # clojure-europe (2)
- # clojure-france (11)
- # clojure-nl (3)
- # clojure-taiwan (2)
- # clojure-uk (23)
- # clojurescript (7)
- # code-reviews (321)
- # conjure (4)
- # data-science (1)
- # depstar (6)
- # fulcro (37)
- # helix (20)
- # juxt (3)
- # keechma (3)
- # leiningen (3)
- # malli (7)
- # nrepl (1)
- # off-topic (20)
- # pathom (25)
- # re-frame (30)
- # reveal (5)
- # shadow-cljs (25)
- # sql (15)
- # tools-deps (4)
- # uncomplicate (2)
- # xtdb (3)
(t/format (tformat/formatter "YYYY") (t/zoned-date-time "2020-12-27T11:00:00Z[Europe/Amsterdam]"))
The above yields "2021"
when ran from repl started as clj -J-Duser.country=US -J-Duser.language=en -Sdeps '{:deps {tick/tick {:mvn/version "0.4.27-alpha"}}}' -e '(require (quote [tick.alpha.api :as t]) (quote [tick.format :as tformat]))' -r
. It yields "2020"
(as expected) when using JVM-options -J-Duser.country=NL -J-Duser.language=en
.
Any idea what’s going on?This relates to the underlying Java DateTimeFormatter, and the fact that Y is week-based year, you might want to use u
instead of Y
- see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/format/DateTimeFormatter.html
@UGD2BGT5Z thanks!