Skip to content

Instantly share code, notes, and snippets.

Created Mar 4, 2013

What would you like to do?
(defn parse-date-str
"Parses str, returns a Calendar object (base format: 'yyyy-MM-dd HH:mm:ss Z')"
(parse-date-str str "yyyy-MM-dd HH:mm:ss Z"))
([str date-format]
(let [c (java.util.GregorianCalendar.)
df (java.text.SimpleDateFormat. date-format)]
(.setTime c (.parse df str)) c)))> (doseq [n x]
#_=> (let [d (extract-time-jp-str n)]
(println d)
(println (parse-date-str d "MM/dd/yyyy HH:mm:ss"))))
03/01/2013 00:00:22:12
ParseException Unparseable date: "03/01/2013 00:00:22:12" java.text.DateFormat.parse (>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.