parsing - Clojure - parse string to date -


i'm trying parse unformatted string contains date (e.g. today = "08082013") format "08.08.2013".

this works: (.parse (java.text.simpledateformat. "ddmmyyyy") today) => <date sun jan 01 00:00:00 cet 1950>

but when (.parse (java.text.simpledateformat. "dd.mm.yyyy") today) error "unparseable date: "08082013"

why? how can desired date format?

to string date, use parse.

to date string, use format.

both use formatter describe transition.

=>(.format     (java.text.simpledateformat. "dd.mm.yyyy")     (.parse       (java.text.simpledateformat. "ddmmyyyy")       "08082013"))  "08.08.2013" 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -