[systemd-devel] Question about timestamps in the USER_RECORD spec

Arian van Putten arian.vanputten at gmail.com
Tue Oct 26 08:41:10 UTC 2021


Hey list,

I'm reading the https://systemd.io/USER_RECORD/ spec and I have a question

There are some fields in the USER_RECORD spec which are described as
"unsigned 64 bit integer values".   Specifically the fields describing
time.

However JSON lacks integers and only has doubles [0]; which would mean 53
bit integer precision is about the maximum we can reach.  It's unclear to
me from the spec whether I should use doubles to encode these fields or use
strings.  Would it be possible to further clarify it?   If it is indeed a
number literal; this means the maximum date we can encode is
9007199254740991 which corresponds to Tuesday, June 5, 2255   . This
honestly is too soon in the future for my comfort.  I suggest encoding 64
bit integers as string literals instead to avoid the truncation problem.

[0] https://datatracker.ietf.org/doc/html/rfc7159#section-6
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20211026/929b250b/attachment.htm>


More information about the systemd-devel mailing list