I am trying to convert time in seconds to timestamp with timezone.
I tried
(defn- seconds-to-milliseconds[time]
(* time 1000))
(:require [clj-time.coerce :as clj-time])
(clj-time/from-long (seconds-to-milliseconds 1564132000))
Result is: #clj-time/date-time"2019-07-26T09:06:40.000Z"
But this result I can not store in Postgres database because i get
PSQLException: Can't infer the SQL type to use for an instance of org.joda.time.DateTime. Use setObject() with an explicit Types value to specify the type to use
So I need to convert it
(clj-time/to-timestamp (clj-time/from-long (seconds-to-milliseconds 1564132000))))
Result is
#inst"2019-07-26T09:06:40.000000000-00:00"
which I can store this in postgres but it don't have time zone.
could anyone help me to convert time in seconds to timestamp with time zone.