Blob


1 (ns blog.time
2 (:import (java.time.format DateTimeFormatter FormatStyle)
3 (java.time LocalDate)
4 (java.util Locale)))
6 (def pattern
7 (DateTimeFormatter/ofPattern "yyyy/MM/dd"))
9 (def loc (Locale/forLanguageTag "en"))
11 (def pattern-loc
12 (DateTimeFormatter/ofPattern "dd MMMM yyy" loc))
14 (defn fmt [d]
15 (.format d pattern))
17 (defn fmt-loc [d]
18 (.format d pattern-loc))
20 (defn parse [s]
21 (LocalDate/parse s pattern))
23 (comment
24 (parse "2020/03/24")
25 (fmt (LocalDate/now))
26 (fmt-loc (LocalDate/now))
27 )