Created
December 7, 2022 23:53
-
-
Save maacl/8815f187410e87e3515e1d44139afe38 to your computer and use it in GitHub Desktop.
Date fun
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shadow.user> (-> | |
(t/local-date 2004 2 29) | |
(t/plus (t/years 1) (t/days 1))) | |
;; => #object[java.time.LocalDate 0x75a742c8 "2005-03-01"] | |
shadow.user> (-> | |
(t/local-date 2004 2 28) | |
(t/plus (t/years 1) (t/days 1))) | |
;; => #object[java.time.LocalDate 0x12132de3 "2005-03-01"] | |
shadow.user> (-> | |
(t/local-date 2004 2 29) | |
(t/plus (t/days 1) (t/years 1))) | |
;; => #object[java.time.LocalDate 0x440f79f "2005-03-01"] | |
shadow.user> (-> | |
(t/local-date 2004 2 28) | |
(t/plus (t/days 1) (t/years 1))) | |
;; => #object[java.time.LocalDate 0x597035d6 "2005-02-28"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great example! The semantics are strange, but it does follow the documented behaviour for LocalDate plusYears