andrewmcveigh / cljs-time

A clj-time inspired date library for clojurescript.
342 stars 57 forks source link

from-default-time-zone & to-default-time-zone do not appear to be inverses of one another #148

Open johanatan opened 1 month ago

johanatan commented 1 month ago

and further, there does not seem to be a way to express a time in the local time zone and have it represented or converted to UTC.

see:

=> (t/from-utc-time-zone (t/date-time 2024 9 10 6 30))
#object[Object 20240910T063000]
=> (t/date-time 2024 9 10 6 30)
#object[Object 20240910T063000]
=> (t/to-default-time-zone (t/date-time 2024 9 10 6 30))
#object[Object 20240909T233000]
=> (t/from-default-time-zone (t/to-default-time-zone (t/date-time 2024 9 10 6 30)))
#object[Object 20240909T233000]
=> (t/from-default-time-zone (t/date-time 2024 9 10 6 30))
#object[Object 20240910T063000]
johanatan commented 1 month ago

I am in the Pacific timezone, so I want a UTC value of 13:30 here by expressing 6:30. i.e., +7 hours offset.

johanatan commented 1 month ago

anyone? this seems like a pretty serious issue for such a common operation.