Created
August 30, 2013 11:23
-
-
Save ilkka/6388908 to your computer and use it in GitHub Desktop.
Strange timezone printing behaviour from the Clojure REPL
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
java -cp ~/Downloads/clojure-1.6.0-master-20130821.123934-9.jar clojure.main | |
Clojure 1.6.0-master-SNAPSHOT | |
user=> (java.util.Calendar/getInstance) | |
#inst "2013-08-30T14:20:22.289+02:00" | |
user=> (let [fmt "yyyy-MM-dd'T'HH:mm:ss.SSSZ" | |
fmter (java.text.SimpleDateFormat. fmt)] | |
(.format fmter (.getTime (java.util.Calendar/getInstance)))) | |
"2013-08-30T14:22:20.755+0300" | |
user=> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For anybody watching, this was a Java 6 problem. Upgrading to 7 fixed it such that the first output gets the correct 3 hour offset.