Skip to content

Instantly share code, notes, and snippets.

@henryw374
Last active June 30, 2021 05:35
Show Gist options
  • Save henryw374/9985f6a8d5ea85d3e7d351770a30d1f4 to your computer and use it in GitHub Desktop.
Save henryw374/9985f6a8d5ea85d3e7d351770a30d1f4 to your computer and use it in GitHub Desktop.
juxt tick
;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