roc-lang / basic-webserver

A basic webserver in Roc

Home Page:https://roc-lang.github.io/basic-webserver/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

toIso8601Str in InternalDateTime does not conform to ISO 8601 Standard

imclerran opened this issue · comments

ISO 8601 says that time should be in the format: hh:mm:ss or hhmmss. A comma or decimal point, for fractions of an hour, minute, or second may be added, but a decimal point should always indicate a fractional amount of the preceding time unit, such as:

  • hh.hh
  • hh:mm.mm
  • hh:mm:ss.ss

In InternalDateTime, the toIso8601Str produces a result of the format YYYY-MM-DDThh:mm.ssZ, which if interpreted by any ISO conformant library, would be interpreted as YYYY-MM-DDThh:mm.mmZ, which of course is not the time represented.

Thus toIso8601Str should be changed to be conformant to the 8601 standard, and format as: YYYY-MM-DDThh:mm:ssZ.