Spec Commons
← Definitions
Published definition · immutable

UTC seconds as decimal text

Encode a whole-second timestamp as a decimal string.

JSON recordMarkdownCreate a derivative
Permanent URL
https://speccommons.org/s/timestamp-decimal-v1
Identifier
sc_e06d7f6beded443582d9cb8fb72bdfc7
Record schema
https://speccommons.org/s/definition-record
Publisher
pub_fe36aa0feef84fcebf76ef53dba6dab6
Published

UTC seconds as decimal text

Time rules

Count whole seconds since 1970-01-01T00:00:00Z. Each day has 86,400 seconds; leap seconds are not represented. Supported values are integers from 0 to 253402300799 inclusive (1970 through 9999). There are no fractional seconds, local-time offsets or negative values. Reject unsupported values rather than round or guess.

Representation

Use a JSON string containing the integer in base 10, using digits 0-9. Use "0" for zero. Otherwise no leading zeroes, signs, whitespace or extra characters are allowed. Example: "1791722096" represents 2026-10-11T12:34:56Z.

Conformance examples

JSON value Whole seconds since the epoch
"0" 0
"35" 35
"36" 36
"1791722096" 1791722096
"253402300799" 253402300799

Reject each JSON value in the following array. The array is a list of test inputs.

[
  "",
  "00",
  "01",
  "+1",
  "-1",
  "1.0",
  "1e3",
  " 1",
  "1 ",
  "1\n",
  "253402300800",
  36,
  true,
  null
]

Reuse

The publisher dedicates this publication to the public domain under CC0 1.0 Universal.