This is not quite to your exact specification, but should help you to write
what you want:
user> (defn to-utc [dt]
(t/to-time-zone dt (t/time-zone-for-offset 0)))
#'user/to-utc
user> (to-utc (t/from-time-zone (t/date-time 1967 7 31 6 30)
(t/time-zone-for-id "America/Caracas")))
#<DateTime 1967-07-31T10:30:00.000Z>
--Steve
On Jun 14, 2014, at 10:09 AM, gvim <[email protected]> wrote:
> I want to convert a time specified with a TZ datababse timezone such as
> "America/Caracas" into a UTC date-time but I can only find in clj-time
> from-time-zone and to-time-zone allowing the zone to be specified as a
> string. I want:
>
> (t/<some-utc-func> (t/date-time 1967 7 31 6 30) (t/time-zone-for-id
> "America/Caracas"))
>
> to give me:
>
> #<DateTime 1967-07-31T10:30:00.000-00:00>
>
> Even the (t/from-time-zone []) output would do if I could read the UTC date
> and time straight from it.
>
> gvim
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.