From f248600ab5065b124f5747b8801596213d68bba6 Mon Sep 17 00:00:00 2001 From: SAY-5 Date: Sun, 10 May 2026 15:10:23 -0700 Subject: [PATCH 1/2] docs: clarify number-to-time conversion in durations.adoc Signed-off-by: SAY-5 --- docs/durations.adoc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/durations.adoc b/docs/durations.adoc index 278e269..8f4df9a 100644 --- a/docs/durations.adoc +++ b/docs/durations.adoc @@ -66,12 +66,14 @@ NOTE: TODO Don't forget you can create zone-offsets from durations! NOTE: TODO Don't forget you can create instants from durations - this is often needed when you get Unix times (e.g. JWT OAuth2 tokens) The problem with numeric times is that there are cases where the units -are in seconds and cases where milliseconds are used. If _tick_ were -to convert numbers to times, it would be a source of confusion and -bugs if the units were not clear. For this reason, you cannot convert -numbers to times. However, you can first create the duration from the -number, specifying the units explicitly, and then convert the duration -to an `instant` (or `inst`). +are in seconds and cases where milliseconds are used. To avoid ambiguity +about the units, the recommended approach is to first create the duration +from the number, specifying the units explicitly, and then convert the +duration to an `instant` (or `inst`). + +NOTE: `t/instant` does accept a bare number for convenience, treating it +as epoch milliseconds. The duration-based form below is preferred because +the units are explicit. [source.code,clojure] ---- From a8950ebc96faf2ceaacba2bab8bf31c6c4da67a5 Mon Sep 17 00:00:00 2001 From: SAY-5 Date: Mon, 11 May 2026 10:58:30 -0700 Subject: [PATCH 2/2] docs: rebuild index.html for durations clarification Signed-off-by: SAY-5 --- docs/index.html | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/docs/index.html b/docs/index.html index 70dd4cf..14f00a6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,7 +4,7 @@ - + tick @@ -2212,12 +2212,24 @@

5.4. Misc

The problem with numeric times is that there are cases where the units -are in seconds and cases where milliseconds are used. If tick were -to convert numbers to times, it would be a source of confusion and -bugs if the units were not clear. For this reason, you cannot convert -numbers to times. However, you can first create the duration from the -number, specifying the units explicitly, and then convert the duration -to an instant (or inst).

+are in seconds and cases where milliseconds are used. To avoid ambiguity +about the units, the recommended approach is to first create the duration +from the number, specifying the units explicitly, and then convert the +duration to an instant (or inst).

+
+
+ + + + + +
+
Note
+
+t/instant does accept a bare number for convenience, treating it +as epoch milliseconds. The duration-based form below is preferred because +the units are explicit. +