-
Notifications
You must be signed in to change notification settings - Fork 1
Spec clarification: Timestamps should explicitly require UTC indicator #13
Copy link
Copy link
Open
Description
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:
- MUST be in UTC (already stated)
- SHOULD include the
Zsuffix 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels