-
Notifications
You must be signed in to change notification settings - Fork 18
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
localtime() misses support for <+/-nn> timezone names #8
Comments
@BlueAndi We can integrate it, although I would prefer if the patch was accepted upstream. Edit: above link is broken, see https://sourceware.org/pipermail/newlib/2020/018144.html instead. |
@igrr I will try and resubmit it this weekend. Before the holidays came up and it just fell to the wayside. |
for those who wonder what the issue means: in esp32 arduino (confirmed with 1.0.6), timezone is broken. additional confusion arises from the official doc which says:
which is not true. time_t now = time(NULL);
setenv("TZ", "<+07>-7", 1);
tzset();
Serial.printf("%s", ctime(&now));
time_t now = time(NULL);
setenv("TZ", "-7", 1);
tzset();
Serial.printf("%s", ctime(&now)); Thu Jan 1 00:00:00 1970 workaround: prefix characters to the offset. time_t now = time(NULL);
setenv("TZ", "FOO-7", 1);
tzset();
Serial.printf("%s", ctime(&now)); Thu Jan 1 07:00:00 1970 even a space works: time_t now = time(NULL);
setenv("TZ", " -7", 1);
tzset();
Serial.printf("%s", ctime(&now)); see if you are affected at: https://github.com/nayarsystems/posix_tz_db/blob/master/zones.csv |
@earlephilhower Did you have time to integrate it? |
I just got hit by this. Are the changes going to be integrated? Or anyone has a pointer that doesn't use the non supported format? |
@igrr You mentioned it should be integrated upstream, can you please point the repository/branch exactly? |
@BlueAndi The upstream repository is https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git. Newlib accepts patches via their mailing list, details are here: https://sourceware.org/mailman/listinfo/newlib/. |
@igrr I posted to the mailing list and it seems they are already working on it: |
The patch for angle brackets support has now been merged upstream: bminor/newlib@539ac66. |
Fixed in esp-2022r1-RC1 toolchain |
The same problem as described here: esp8266/Arduino#4637
The fix for the newlib can found here: earlephilhower/newlib-xtensa#14
@igrr You were involved in the original issue too, would it be possible to integrate here, to get it for the esp32 too?
The text was updated successfully, but these errors were encountered: