clojure - How to convert java.sql.Timestamp to UTC-based string? -


when call .tostring on java.sql.timestamp instance, formatted string in local time zone. want formatted string based off of utc, 1 see in representation. how can 1 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 use dateformat, presumably common issue i'm wondering if there's else?

read this: converting local timestamp utc timestamp in java

or can joda time convert local time utc better way it.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

node.js - Bad Request - node js ajax post -

uitableview - Create and use custom prototype table cells in xamarin ios using storyboard -