Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timestamp time zone? #1468

Closed
alphapapa opened this issue Aug 1, 2018 · 5 comments · Fixed by #2097
Closed

Timestamp time zone? #1468

alphapapa opened this issue Aug 1, 2018 · 5 comments · Fixed by #2097
Assignees
Labels
clarification An area where the spec could do with being more explicit client-server Client-Server API

Comments

@alphapapa
Copy link

I looked at every mention of "timestamp" in https://matrix.org/docs/spec/client_server/r0.3.0.html, and searched for mentions of "time zone" or "timezone", but I found no explanation of what time zone timestamps are in--the spec only says that they are "Timestamp in milliseconds on originating homeserver." Some of the mentions of "timestamp" also say "Unix epoch," which may (or even should) imply UTC. However, I think that the time zone should be made explicit in the spec.

@turt2live turt2live added the clarification An area where the spec could do with being more explicit label Aug 1, 2018
@turt2live
Copy link
Member

It is UTC, although yes: all mentions of it should say it's a unix epoch timestamp.

@richvdh
Copy link
Member

richvdh commented Aug 1, 2018

unix timestamps don't have a timezone really - that's one of the nice things about them!

@alphapapa
Copy link
Author

alphapapa commented Aug 1, 2018

@richvdh Well, according to https://en.wikipedia.org/wiki/Unix_time:

Unix time (also known as POSIX time[citation needed] or UNIX Epoch time) is a system for describing a point in time, defined as an approximation of the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970.

The fact that they are (supposed to be) in UTC is important, because otherwise the time zone would have to be carried separately. It also makes conversion to local time easier, because conforming implementations (e.g. Emacs's format-time-string) can automatically format timestamps into the local time zone for display. Imagine what a mess it would be if each server reported timestamps in its local time zone, and clients had to convert timestamps between timezones manually!

@richvdh
Copy link
Member

richvdh commented Aug 1, 2018

I think we're agreeing. The point is that the number of milliseconds since the epoch is independent of your timezone, because the epoch is at a defined point in time.

@alphapapa
Copy link
Author

I guess it depends on whether you consider UTC a "time zone." :)

@turt2live turt2live added the client-server Client-Server API label Sep 5, 2018
@turt2live turt2live self-assigned this Jun 6, 2019
turt2live added a commit that referenced this issue Jun 6, 2019
See #2061
Fixes #1468
Fixes #1528

The section is not referenced by the specifications yet - they do a fairly good job of explaining it over and over. In future, it would be good to point all the references to the index.
RiotTranslateBot pushed a commit to RiotTranslateBot/matrix-doc that referenced this issue Aug 22, 2023
Signed-off-by: Stuart Mumford <stuart@cadair.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification An area where the spec could do with being more explicit client-server Client-Server API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants