relvacode / iso8601

A fast ISO8601 date parser for Go
MIT License
144 stars 16 forks source link

Timezones with minute offsets #3

Closed dacz closed 5 years ago

dacz commented 5 years ago

I’m afraid that timezones can be non hour, so the expectation mentioned in code is not correct.

relvacode commented 5 years ago

Do you have any reference to support that? This is taken straight from Wikipedia

Time zones in ISO 8601 are represented as local time (with the location unspecified), as UTC, or as an offset from UTC.

dacz commented 5 years ago

https://en.wikipedia.org/wiki/Time_zone

To cite: Most of the time zones on land are offset from Coordinated Universal Time (UTC) by a whole number of hours (UTC−12 to UTC+14), but a few zones are offset by 30 or 45 minutes (e.g. Newfoundland Standard Time is UTC−03:30, Nepal Standard Time is UTC+05:45, and Indian Standard Time is UTC+05:30).

dacz commented 5 years ago

So it's a little bit weird that ISO 8601 works only with hours. Being from India I would be sad :)

relvacode commented 5 years ago

Ah I understand, not named timezones as in GMT or PST. Okay I'll work up a fix

dacz commented 5 years ago

Well done!