Skip to content

Spec clarification: Timestamps should explicitly require UTC indicator #13

@mwiesen

Description

@mwiesen

Summary

The SPXP specification states that timestamps are in UTC, but the examples and actual implementations use timestamps without the Z suffix (or +00:00), which can lead to ambiguity.

Current Behavior

The spec says timestamps are UTC, but examples show:

{
  "seqts": "2018-09-17T14:04:27.373",
  "createts": "2018-09-16T12:23:18.751"
}

Problem

Without an explicit timezone indicator, parsers may interpret these as local time:

// Ambiguous - could be parsed as local time
new Date('2018-09-17T14:04:27.373')

// Explicit UTC - no ambiguity
new Date('2018-09-17T14:04:27.373Z')

This can cause issues when:

  • Clients are in different timezones
  • Sorting posts chronologically
  • Displaying "posted X hours ago" relative times

Suggestion

Clarify in the spec that timestamps:

  1. MUST be in UTC (already stated)
  2. SHOULD include the Z suffix for ISO 8601 compliance

Example:

{
  "seqts": "2018-09-17T14:04:27.373Z",
  "createts": "2018-09-16T12:23:18.751Z"
}

Alternatively, explicitly state that the absence of a timezone indicator implies UTC, so client implementations know to handle it correctly.

References


Discovered while building a browser-based SPXP profile viewer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions