fmidev / metcoop-wg-backend

MetCoOp Working Group Backend repository
0 stars 1 forks source link

Should timestamps be in UTC time or not? #2

Closed tervo closed 4 years ago

tervo commented 4 years ago

Discuss should timestamps be in UTC time or not? Also, add a statement that timestamp shall always include timezone information.

petringo commented 4 years ago

Google states about date/time fields in their CAP profile:

  1. If the location cited in the <area> block falls within a single timezone, <effective> SHOULD specify time in that zone, including allowance for Daylight Savings when applicable.
  2. When the content of a message applies across multiple timezones, the message producer SHOULD use UTC times in preference to local times.

I find this practical. In general all of our alerts would fall to the first case above. Therefore I would suggest using local time. Anyway time zone offset is always mandatory in CAP date/time fields by specification.

tervo commented 4 years ago

All languages shall be in the same timezone. Norway gives flood and avalanche warnings in local time so this issue need to be discussed more. If Google CAP profile is followed, at least part of the marine warnings (or all) should be in UTC. Land warnings would then be in local time.

a001090 commented 4 years ago

As long as dates follow ISO 8601 and it is clear which timezone is used (Which i believe the standard says), I'm happy with either or.

tervo commented 4 years ago

Local time with timezone included seems the best option.

petringo commented 4 years ago

As long as dates follow ISO 8601 and it is clear which timezone is used (Which i believe the standard says), I'm happy with either or.

@a001090 just to be explicit, dateTime elements in CAP are not ISO 8601, but are compatible in general (except for the Z zone). The CAP specification refers to XML Schema dateTime data type and makes some clarifications in chapter 3.3.2 DateTime Data Type.

tervo commented 4 years ago

Updated in https://git.smhi.se/metcoop/metcoop-cap-profile/blob/version-1.0/metcoop-cap-profile.md

a001090 commented 4 years ago

As long as dates follow ISO 8601 and it is clear which timezone is used (Which i believe the standard says), I'm happy with either or.

@a001090 just to be explicit, dateTime elements in CAP are not ISO 8601, but are compatible in general (except for the Z zone). The CAP specification refers to XML Schema dateTime data type and makes some clarifications in chapter 3.3.2 DateTime Data Type.

It's a bit strange in the standard the ASN.1 schema mentions ISO8601 but the XML schema and textual description doesn't.... not the we can do anything about it but it is kind of inconsistent.