如何将从cli -time得到的结果转换为实际日期?
require [clj-time.core :as t]
(t/today)
;; [#<LocalDate 2015-08-25> 15]
我需要这样的日期:
;; 2015-08-25
joda time,因此clj-time以某种方式区分"regular" date-time和local-date-time;因为(t/today)
是org.joda.time.LocalDate
试试unparse-local
:
user=> (f/unparse-local (f/formatter "Y-MM-dd") (t/today))
"2015-08-25"