summaryrefslogtreecommitdiff
path: root/core/api-common.rst
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-12-19 22:08:32 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-12-19 22:08:32 +0100
commit687af63c29a6b8e09e8f5d4becd035b12d0d0295 (patch)
tree5f9a9125428d328e866b0a46b49753274514199f /core/api-common.rst
parentf9e75e4e351a18cd61383554c9aea2af6038f2b5 (diff)
downloaddocs-687af63c29a6b8e09e8f5d4becd035b12d0d0295.tar.gz
docs-687af63c29a6b8e09e8f5d4becd035b12d0d0295.tar.bz2
docs-687af63c29a6b8e09e8f5d4becd035b12d0d0295.zip
update timestamp docs
Diffstat (limited to 'core/api-common.rst')
-rw-r--r--core/api-common.rst22
1 files changed, 12 insertions, 10 deletions
diff --git a/core/api-common.rst b/core/api-common.rst
index eb40a629..6199bb63 100644
--- a/core/api-common.rst
+++ b/core/api-common.rst
@@ -145,22 +145,24 @@ as other binary data in Crockford Base32 encoding.
Timestamps
^^^^^^^^^^
-Timestamps are represented in JSON as a string literal ``"\\/Date(x)\\/"``,
-where ``x`` is the decimal representation of the number of seconds past the
-Unix Epoch (January 1, 1970). The escaped slash (``\\/``) is interpreted in
-JSON simply as a normal slash, but distinguishes the timestamp from a normal
-string literal. We use the type "date" in the documentation below.
-Additionally, the special strings ``"\\/never\\/"`` and ``"\\/forever\\/"`` are
-recognized to represent the end of time.
+Timestamps are represented by the following structure:
.. ts:def:: Timestamp
- type Timestamp = string;
-
+ interface Timestamp {
+ // Milliseconds since epoch, or the special
+ // value "forever" to represent an event that will
+ // never happen.
+ t_ms: number | "never";
+ }
.. ts:def:: RelativeTime
- type RelativeTime = string;
+ type Duration {
+ // Duration in milliseconds or "forever"
+ // to represent an infinite duration.
+ d_ms: number | "forever";
+ }
.. _public\ key: