Created
January 22, 2020 22:31
-
-
Save aarkerio/61d7a34e869b1c0628be2c753d2ee72e to your computer and use it in GitHub Desktop.
Clojure. Format an Instant
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(:require [java-time :as jt])) | |
(defn format-date | |
"Format a Java instant" | |
[date] | |
(let [formatter (jt/format "dd-MM-yyyy HH:mm")] | |
(jt/format formatter (.atZone date (jt/zone-id))))) | |
;; clj-time is now deprecated |
ghost
commented
Apr 27, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment