Skip to content

Instantly share code, notes, and snippets.

@ilkka
Created August 30, 2013 11:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilkka/6388908 to your computer and use it in GitHub Desktop.
Save ilkka/6388908 to your computer and use it in GitHub Desktop.
Strange timezone printing behaviour from the Clojure REPL
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=>
@ilkka
Copy link
Author

ilkka commented Aug 30, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment