0

I have the following error :

IllegalArgumentException Parameter declaration .format should be
a vector  clojure.core/assert-valid-fdecl (core.clj:6732)

With this simple function :

(defn getNowDateString

    (.format(java.text.SimpleDateFormat. "ddMMyyyy:HHmmss")(java.util.Date.)))
)

Edit :

In the REPL

 => (.format(java.text.SimpleDateFormat. "ddMMyyyy:HHmmss")(java.util.Date.)))
 "23072013:094839"

Thank you !

2 Answers 2

2

I'd recommend you to switch from java.util.Date to clj-time, it's the best datetime solution for clojure:

(unparse (formatter "ddMMyyyy:HHmmss") (now))
Sign up to request clarification or add additional context in comments.

Comments

1

Sorry, I forgot vector for function params.

(defn getNowDateString []

    (.format(java.text.SimpleDateFormat. "ddMMyyyy:HHmmss")(java.util.Date.)))
)

Thank you !

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.