News for hackers. Stuff that matters.
Re:Best practices for REST API design (2020) by crescentfresh on Monday February 22, 2021 @03:32PM (#26230178)
> Send ISO date/time in utc

what's an ISO date/time?

Re:Best practices for REST API design (2020) by ehutch79 on Monday February 22, 2021 @03:36PM (#26230218)
Re:Best practices for REST API design (2020) by lyjackal on Monday February 22, 2021 @03:35PM (#26230212)
I assume GP means ISO8601 Date Time https://en.wikipedia.org/wiki/ISO_8601. Default behavior of javascript date json serialization

  > JSON.stringify(new Date())
  '"2021-02-22T20:34:53.686Z"'
Re:Best practices for REST API design (2020) by tshaddox on Monday February 22, 2021 @05:09PM (#26231343)
Then why add the "in UTC" part? ISO 8601 specifies how to designate the time zone.
Re:Best practices for REST API design (2020) by uranusjr on Monday February 22, 2021 @05:32PM (#26231582)
ISO 8601 does not contain timezone information, but offset. Timezone info needs to be specified separately, likely as IANA names. It is a common misconception to time zones though, and in a way demonstrates why it’s best practice to always use UTC. When sending/receiving a datetime, no timezone info is available; if timezone is needed, send it separately (and keep the time value in UTC) to save misunderstandings for everyone.
Re:Best practices for REST API design (2020) by tshaddox on Monday February 22, 2021 @06:20PM (#26232000)
I'm aware of the distinction between ISO 8601's time zone designators (which are simply UTC offsets) and other much more complex notions of time zones such as the IANA tz database (which identifies time zones with an "Area/Location" string and contains information about each zone such as daylight saving time rules and even the historical changes in such rules).

That said, "time zone designator" is the formal name of the UTC offset in ISO 8601, and it's reasonable to refer to it as such whenever the distinction is clear.

Re:Best practices for REST API design (2020) by jshprentz on Monday February 22, 2021 @05:16PM (#26231415)