2017-06-12 68 views

回答

2

如果你有java.util.Date对象:

(type #inst "2017-01-01T12:00:00+02:00") 
;;=> java.util.Date 

clj-timeclj-time.coerce命名空间与from-date函数,它java.util.Date对象作为输入。例如:

(require '[clj-time.coerce :as c]) 

((juxt type str) (c/from-date #inst "2017-01-01T12:00:00")) 
;;=> [org.joda.time.DateTime "2017-01-01T12:00:00.000Z"] 
相关问题