It seems like equality is implemented using clojure.core/= [1, 2, 3], resulting in the following surprising output in 1.4.3:
(require '[java-time :as jt])
> (let [zdt (jt/zoned-date-time)]
(jt/= (jt/with-zone-same-instant zdt "UTC")
(jt/with-zone-same-instant zdt "Z")))
false
For comparison, here's java.time and juxt/tick:
> (let [zdt (java.time.ZonedDateTime/now)]
(.isEqual (.withZoneSameInstant zdt (java.time.ZoneId/of "UTC"))
(.withZoneSameInstant zdt (java.time.ZoneId/of "Z"))))
true
(require '[tick.core :as tick])
> (let [zdt (tick/zoned-date-time)]
(tick/= (tick/in zdt "UTC")
(tick/in zdt "Z")))
true
It seems like equality is implemented using
clojure.core/=[1, 2, 3], resulting in the following surprising output in 1.4.3:For comparison, here's java.time and juxt/tick: