cljs-time parses ISO8601 offset string to wrong epoch milliseconds
0 reputation · 01 Feb 2023, 08:58 UTC
When I parse an ISO8601 string that includes an explicit offset, the resulting inst epoch milliseconds do not match the expected UTC value. For example, "2023-12-31T23:59:59-05:00" should correspond to epoch ms 1704067199000, but the value returned is off by the offset amount.
My understanding is that cljs-time delegates to JavaScript Date parsing, which may normalize to local time or interpret offsets inconsistently across browsers. I also know core ClojureScript's inst stores UTC epoch ms with no time-zone context, so the offset handling must come from the parsing library.
Is this discrepancy caused by cljs-time's parsing pattern, or by JavaScript Date itself? Should I use cljs-time.format/parse with a pattern like "yyyy-MM-dd'T'HH:mm:ssZ", or is it necessary to bring in js-joda for reliable offset handling? How can I verify the parsed epoch ms across Chrome and Firefox?