(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
@caroline.appleby thanks!