I'm confused on usage of the clojure.java-time library usage that wraps Java 8's java.time api.
I want a function that translates a date in string format from "yyyy-MM-dd'T'HH:mm:ss" format to "MM/dd/YYYY hh:mm:ss a" format.
Here's my function:
(require '[java-time :as jt])
(defn change-ds-format [in-ds]
{:pre [string? in-ds ]}
(let [input-format "yyyy-MM-dd'T'HH:mm:ss"
output-format "MM/dd/YYYY hh:mm:ss a"]
(->> in-ds
(jt/local-date-time input-format)
(jt/format output-format))))
This looks ok:
(change-ds-format "2019-12-28T00:00:00" )
;=> "12/28/2019 12:00:00 AM"
I have no idea why this is pushed to 2020?
(change-ds-format "2019-12-29T00:00:00" )
;=> "12/29/2020 12:00:00 AM"
;; Why is this one 2020 ???
I thought maybe it was a timezone offset issue but there is no way it should be shifting to the year 2020 I don't believe.