-
Notifications
You must be signed in to change notification settings - Fork 3.4k
put_time returning time zone as "Easter" #21582
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
Comments
I believe this is due to #21375. The max number of chars in timezone name in POSIX is defined to be 6 (
If we could fix node on windows to give the abbreviated name (EDT) would that be enough to fix your issue? Or do you really need/want to full unabbreviated name? |
Wow, fast answer. Abbreviated name works for me, that's what we're getting on iOS and Mac already. Thanks! |
Sadly I couldn't find any easy way to get such names on windows :( BTW is node your target environment or it the browser? Do you know if the same results are produced when running the browser on windows? |
It's a browser app. I get the same (Easter) when I run it on Chrome in Windows. |
OK, in that case I think we need to increase out TZNAME_MAX so allow for these windows timezone names. |
If it helps, the TIME_ZONE_INFORMATION struct uses a max length of 32 for Windows timezone names. Ironically the example on that page shows a return value of "EST" for the StandardName and DaylightName, but when I call GetTimeZoneInformation I get the full "Eastern Daylight Time". |
Thanks @jrobichaux , do you happen to know if there is any way to access the |
Without this change then timezone names will be the long form (Pacific Standard Time) rather than the short form (PST), and since TZNAME_MAX in musl is 6 (same in POSIX) the long names were getting truncated. Fixes emscripten-core#21582
Without this change then timezone names will be the long form (Pacific Standard Time) rather than the short form (PST), and since TZNAME_MAX in musl is 6 (same in POSIX) the long names were getting truncated. Fixes emscripten-core#21582
Without this change then timezone names will be the long form (Pacific Standard Time) rather than the short form (PST), and since TZNAME_MAX in musl is 6 (same in POSIX) the long names were getting truncated. Fixes #21582
Not that I know of. I was just thinking if you were going to increase the size of But I saw what you did in #21585 by using Javascript directly, and that's a good/clever workaround. Thanks! |
In the latest emscripten, a call to
std::put_time( std::localtime(&t_time), "%Z" )
on my Windows machine returns "Easter" instead of "Eastern Daylight Time".This worked properly on the previous version I was using (3.1.51).
Minimal repro:
time_test.cpp
Compile with:
em++ time_test.cpp
Run with:
node a.out.js
On my machine (Windows 10) this returns "time zone = Easter". If I compile as a standard Windows executable it properly returns "time zone = Eastern Daylight Time".
Version of emscripten/emsdk:
The text was updated successfully, but these errors were encountered: