Created
March 4, 2013 16:20
-
-
Save anonymous/5083422 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn parse-date-str | |
"Parses str, returns a Calendar object (base format: 'yyyy-MM-dd HH:mm:ss Z')" | |
([str] | |
(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))) | |
markus.is.cool=> (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 (DateFormat.java:358) | |
markus.is.cool=> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment