When you call .toString
on a java.sql.Timestamp
instance, you get back a formatted string in your local time zone. I want a formatted string based off of UTC, like the one that I see in the representation. How can I get the one from the representaion?
user> (def timestamp (doto (java.sql.Timestamp. 1366156869000) (.setNanos 42)))
#'user/timestamp
user> timestamp
#inst "2013-04-17T00:01:09.000000042-00:00"
user> (str timestamp)
"2013-04-16 20:01:09.000000042"
I know that I could use a DateFormat
, but presumably this is a common issue so I'm wondering if there's something else?