pacifica / pacifica-metadata

Pacifica core service that stores the metadata for the system
GNU Lesser General Public License v3.0
1 stars 8 forks source link

Timestamps should be zoned #75

Open markborkum opened 6 years ago

markborkum commented 6 years ago

Pacifica Metadata version

1.0

Pacifica Core Software versions

n/a

Platform Details

All supported platforms.

Scenario:

Client retrieves JSON encoding of one or more records using HTTP end-point. Client expects timestamps to be encoded using the ISO 8601 standard. Client attempts to parse timestamp. Parsing fails.

Steps to Reproduce:

  1. Issue HTTP GET request to end-point, e.g., GET /users?_id=12345.

Expected Result:

Timestamps (e.g., "created", "updated", and "deleted") should be zoned, i.e., should include time zones using the ISO 8601 standard.

For example, using the ISO 8601 standard, if the timestamps are localized to Zulu time:

{
  "_id": 12345,
  ...
  "created": "2017-12-25T00:00:00Z",
  "updated": "2017-12-25T00:00:00Z",
  "deleted": null
}

where the "Z" suffix denotes Zulu time.

Alternatively, using the ISO 8601 standard, if the timestamps are not localized:

{
  "_id": 12345,
  ...
  "created": "2017-12-25T00:00:00+00:00",
  "updated": "2017-12-25T00:00:00+00:00",
  "deleted": null
}

where the "+00:00" suffix denotes the time zone.

Actual Result:

Timestamps are not zoned.

{
  "_id": 12345,
  ...
  "created": "2017-12-25T00:00:00",
  "updated": "2017-12-25T00:00:00",
  "deleted": null
}
dmlb2000 commented 6 years ago

Timezones are another one of those difficult things to get right, like unicode and locale messages...

The plan here has always been that we store UTC times and we need to provide UTC timezones. The interfaces are designed for other user applications to consume and it's up to them to localize the timezone for the users interacting with the system.