Open seryh opened 7 years ago
Did this work on previous versions?
Thank you, in the version of "0.4.0" is working:
;;[com.andrewmcveigh/cljs-time "0.4.0"]
(let [format (formatters :date-time)]
(unparse format (local-date-time (now))))
;; => "2016-12-13T12:10:32.814+07:00"
But I was too deeply embedded in my project version "0.5.0-alpha2" so used the fix:
;; [com.andrewmcveigh/cljs-time "0.5.0-alpha2"]
(let [date (cljs-time.local/local-now)
date-format (formatters :date-time)
str-date (as-> date $
(unparse date-format $)
(str $ (.getTimezoneOffsetString date)))]
str-date)
;; => "2016-12-13T12:16:22.361+07:00"
experiencing this bug too here with 0.5.0-alpha2
I'm having a similar issue.
(let [format (cljs-time.format/formatters :date-time-no-ms)]; or "yyyy-MM-dd'T'HH:mm:ssZZ"
(cljs-time.format/parse-local format "2017-12-20T12:00:00+02:00"))
;;0.4.0
;; => #object[Object 20171220T120000]
;;0.5.2
;; => #object[Object 20171220T100000]
I ran into this same issue. I'm not sure what's causing it, but I couldn't find a way around it with cljs-time, so I switched to a different library.
I use
[com.andrewmcveigh/cljs-time "0.5.0-alpha2"]
ZZ - it was ignored; I expected to see
"2016-12-12T13:34:52.992+07:00"
, how to get the string with time zone?