Skip to content
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

Help newlib TZ parser #7699

Merged
merged 3 commits into from
Nov 10, 2020
Merged

Help newlib TZ parser #7699

merged 3 commits into from
Nov 10, 2020

Conversation

d-a-v
Copy link
Collaborator

@d-a-v d-a-v commented Nov 10, 2020

Timezones coded with <±nn>±nn<±nn>[±nn][,...] are incorrectly parsed by newlib's TZ parser.
In these timezones, <±nn> is used because there is no matching name like in other timezones.
Example:

  • GMT0BST for London, (GMT is known, BST is British Summer Time).
  • <+1030>-10:30<+11>-11 for Lord Howe Island.

These names GMT,BST,CET,... are meant to be human readable but are useless in our use case.
Replacing <±nn> occurences by UNKnown allows newlib's TZ parser to nicely interpret all timezones.
UNK-10:30UNK-11 is then correctly parsed.

Ultimately, newlib should handle such TZ descriptors. Until then, they are handled by this script.

Fixes #7690

Timezones coded with <±nn>±nn<±nn>[±nn][,...] are incorrectly parsed by newlib's TZ parser.
In these timezones, <±nn> is used because there is no matching name like in other timezones.
Example: 'GMT0BST' for London, (GMT is known, BST is 'British Summer Time').
Example: '<+1030>-10:30<+11>-11' for Lord Howe Island.
These names GMT,BST,CET,... are meant to be human readable but are useless in our use case.
Replacing <±nn> occurences by UNK allows newlib's TZ parser to nicely interpret all timezones.
Ultimately, newlib should handle such tz descriptor. Until then, they are handled by this script.
@earlephilhower
Copy link
Collaborator

Would you like to put in a bug on the newlib repo for this change? https://github.com/earlephilhower/newlib-xtensa

@d-a-v d-a-v merged commit 4de681b into esp8266:master Nov 10, 2020
@d-a-v d-a-v deleted the helpnewlibtzparser branch November 10, 2020 22:35
@d-a-v
Copy link
Collaborator Author

d-a-v commented Nov 10, 2020

For reference

earlephilhower added a commit to earlephilhower/Arduino that referenced this pull request Nov 12, 2020
Undoes the change in esp8266#7699 and fixed esp8266#7690 root cause.

Newlib did not support timezone names of the form "<[+-]?[0-9]+>" and
would parse the offset using the <name>.

Fix newlib tzset parser with
  earlephilhower/newlib-xtensa#14
and undo the UNK changes used as an expedient workaround.
earlephilhower added a commit that referenced this pull request Nov 12, 2020
Undoes the change in #7699 and fixed #7690 root cause.

Newlib did not support timezone names of the form "<[+-]?[0-9]+>" and
would parse the offset using the <name>.

Fix newlib tzset parser with
  earlephilhower/newlib-xtensa#14
  earlephilhower/newlib-xtensa#15
and undo the UNK changes used as an expedient workaround.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some POSIX time zones are not handled correctly
2 participants