Mi Michael,

On 24.04.23 15:40, Michal Vasko wrote:

Hi Eliot,

thanks for the answer. From what you wrote I assume that your explanation is based on RFC 3339 but I could not find this behavior specified there, only a note (second bullet) <https://www.rfc-editor.org/rfc/rfc3339#section-1> that the exact situation we are discussing is not considered.

Yes indeed it is.  You sort of have to construct it based first on §4.2 of that memo as follows:

   Numeric offsets are calculated as "local time minus UTC".  So the
   equivalent time in UTC can be determined by subtracting the offset
   from the local time.  For example, 18:50:00-04:00 is the same time as
   22:50:00Z.  (This example shows negative offsets handled by adding
   the absolute value of the offset.)

And then you have to consider a somewhat more general purpose of timestamps, which is to note what time it was when a timestamp was created.  If the computer is configured with +12 or +13, so long as the timestamp indicates that, you can construct the UTC time.

If you are generating a timestamp for an event in the future, there is no perfect if you are translating localtime, localtime definitions may change.

If you are generating a timestamp for a time in the past based on localtime, in order to get it correct for the system you are on, you must be able to know what the mapping was in the past*.* The TZ database does a pretty good job at retaining that information, but once you leave one system, you may suffer version skew of that database.  Again, there is no perfect.

What you oughtn't do is assume that the computer got the local offset wrong only in the timestamp ;-)

In any case, adding a sentence mentioning this situation in the type description may be useful to ensure the canonical value is unambiguous. Not sure if errata would be acceptable or it can be added only once some updated YANG module is being defined (if that happens).

Where would you make the clarification?  Also, I believe there is an RFC 3339 update underway somewhere at the IETF.  See draft-ietf-sedate-datetime-extended-07.txt, and maybe chat with the authors/sedate WG.

Eliot
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to