Posted By

ef on 12/13/11


Tagged

date clojure iso8601


Versions (?)

Clojure ISO 8601 current date


 / 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/

  1. (defn get-current-iso-8601-date
  2. "Returns current ISO 8601 compliant date."
  3. [] (.format (SimpleDateFormat. "yyyy-MM-dd'T'HH:mm:ssZ") (.getTime (Calendar/getInstance))))

Report this snippet  

You need to login to post a comment.