创建日期

基本类型 / 日期和时间

(import '[java.time LocalDate LocalDateTime])

; 只有日期
(def victory-day (LocalDate/of 1945 5 9))

; 带时间的日期
(def victory-moment (LocalDateTime/of 1945 5 9 1 0))

; 从 ISO 文本读取的同一天
(def parsed-day (LocalDate/parse "1945-05-09"))

(println "victory-day is" (str victory-day))
(println "victory-moment is" (str victory-moment))
(println "parsed-day is" (str parsed-day))
(println "all three days are equal:" (= victory-day parsed-day
                          (.toLocalDate victory-moment)))