-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limits on UTC offset #272
Comments
The offset limits are right there since the introduction in c156e91. I cannot find a reasoning to these limits. The parser in https://ijmacd.github.io/rfc3339-iso8601/ accepts e.g. ISO8601 and RFC3339 don't allow seconds in the offsets, and I'm not sure we should either. -23:59 is allowed as e.g. RFC grammar is
note |
OTOH, Prelude Data.Time> parseTimeM True defaultTimeLocale "%Z" "+99:99" :: Maybe TimeZone
Just +10039
|
Resolve #272. Allow 23:59 as maximum/minimum tz offset
I'll admit this issue is a bit of a judgement call, but the limits being imposed on the utc offset may be a teensy bit too strict.
The IANA tz database has (at least) eight time zones that have exceeded the current
-12
to+14
limit:Asia/Manila
,Pacific/Guam
andPacific/Saipan
before1844-12-31
, as well asAmerica/Metlakatla
,America/Juneau
,America/Sitka
,America/Yakutat
, andAmerica/Anchorage
before1867-10-18
. But, assuming I'm not missing something, it does appear that this limit is valid since 1868.However, the IANA tz offsets before the respective dates are all local mean time, which means most of them are not offset an integer number of minutes from UTC. So one could argue that loosening the limit isn't all that meaningful without also supporting
±HH:MM:SS
offsets.So, for whatever it's worth here's some example syntax that PostgreSQL will generate, based on the tz database:
And the
±HH:MM:SS
syntax is not limited to obscure timezones; indeed almost every IANA timezone will generate it:And as far as I can tell, the following is the most recent timestamp that will be generated with the
±HH:MM:SS
syntax:The text was updated successfully, but these errors were encountered: