This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-13
Channels
- # adventofcode (37)
- # announcements (11)
- # babashka (46)
- # beginners (35)
- # biff (1)
- # clojure (44)
- # clojure-austin (1)
- # clojure-europe (23)
- # clojure-nl (2)
- # clojure-norway (8)
- # clojure-uk (5)
- # conjure (3)
- # cursive (22)
- # data-science (13)
- # docker (11)
- # events (8)
- # hyperfiddle (7)
- # joyride (1)
- # juxt (9)
- # malli (7)
- # matrix (4)
- # pedestal (3)
- # podcasts-discuss (1)
- # portal (1)
- # re-frame (62)
- # reitit (2)
- # releases (1)
- # schema (3)
- # sql (14)
- # squint (3)
- # xtdb (6)
- # yamlscript (4)
In tick, since date
is a local date w/o timezone info and and Instant
doesn't have timezone info either, why does it have to pass the Instant through zoned-date-time
first? This manifested in a bug for me where I had a "Jan 01 00:00:00" instant and passed it to date
, resulting in "Dec 31" while my timezone was set to Honolulu (in cljs)
hello. firstly, this isnt a tick issue - but a java.time one. and it does trip people up... so much so that it is only one of 3 top tips
in the readme: https://github.com/juxt/tick?tab=readme-ov-file#instants.
It's explained in the readme What Henry said
https://github.com/juxt/tick#instants
the library is an abstraction over java.time. I would definitely recommend reading the relevant java docs, the whole tick api made so much more sense to me after that.
https://docs.oracle.com/javase/8/docs/api/java/time/package-summary.html
https://docs.oracle.com/javase/8/docs/api/java/time/format/package-summary.html
https://docs.oracle.com/javase/8/docs/api/java/time/temporal/package-summary.html
https://docs.oracle.com/javase/8/docs/api/java/time/zone/package-summary.html
and the tutorial is linked in the tick docs
https://docs.oracle.com/javase/tutorial/datetime/iso/overview.html
t/zone
of instant
is hard coded to "UTC". I my case I expected it to use that when going from instant
to local-date
instead of (current-zone)
but I guess that is highly subjective and dependent on the problem. I would argue though that it's less of an issue in java.time because it doesn't allow you to go from Instant to LocalDate without explicitly passing a Zone.
Thank you for your answers and the links, I will study the the java.time API documentation some more!