Last active
June 30, 2021 05:35
-
-
Save henryw374/9985f6a8d5ea85d3e7d351770a30d1f4 to your computer and use it in GitHub Desktop.
juxt tick
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
;local date to native date (js/Date or java.util.Date.) | |
(-> d | |
(cljc.java-time.local-date/at-start-of-day (t/zone "UTC")) | |
(t/inst)) | |
; native date (js/Date or java.util.Date.) to local date | |
(-> (java.util.Date.) | |
t/instant | |
(cljc.java-time.zoned-date-time/of-instant (t/zone "UTC")) | |
t/date) | |
; zdt from millis | |
(-> (t/instant (System/currentTimeMillis)) | |
(t/in (t/zone "Pacific/Honolulu"))) | |
; print out a month | |
(t/format (t/formatter "MMM") tick.alpha.api/MARCH) => Mar | |
(t/format (t/formatter "MMMM") tick.alpha.api/MARCH) => March |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment