Clojure ISO 8601 current date


/ Published in: Clojure
Save to your folder(s)

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/


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.