/ Published in: Clojure

Return string representing current date in ISO 8601 format, e.g. "2011-12-12T20:50:22+0100".
java.util.Calendar and java.text.SimpleDateFormat have to be imported first.
NOTICE: Use this instead: http://snipplr.com/view/62060/clojure-iso-8601-current-date-with-cljtime/
java.util.Calendar and java.text.SimpleDateFormat have to be imported first.
NOTICE: Use this instead: http://snipplr.com/view/62060/clojure-iso-8601-current-date-with-cljtime/
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
(defn get-current-iso-8601-date "Returns current ISO 8601 compliant date." [] (.format (SimpleDateFormat. "yyyy-MM-dd'T'HH:mm:ssZ") (.getTime (Calendar/getInstance))))
Comments
