-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 wtih strftime does not seem to work properly #9472
Comments
Unrelated to the problem, do you maybe want to use the mingw gcc instead? |
That is what I've done, so maybe I should I report this to mingw instead? |
Yeah, I think I've confused something things. If I use an MSYS terminal, and change |
I see. I get under mingw64: |
So it looks to me that msvcrt is lacking those features. This looks related: https://sourceforge.net/p/mingw-w64/bugs/793/ If you depend on your mingw builds behaving like with MSVC I'd suggest to use the ucrt64 (or clang) environment instead. See https://www.msys2.org/docs/environments/ for details |
Ah, I haven't used msys in a while and didn't realize it worked this way. How do I install the ucrt64 environment? I can't seem to figure it out. |
It's there by default, |
Ah, thank you.
…On Thu, Aug 26, 2021 at 4:22 PM Christoph Reiter ***@***.***> wrote:
It's there by default, C:/msys64/ucrt64.exe. its packages/groups start
with mingw-w64-ucrt-x86_64-, for example pacman -S
mingw-w64-ucrt-x86_64-toolchain
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9472 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACB3DN3WDGFG66HUCYTKM4TT62WCLANCNFSM5C37AYBQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
There's a very good chance I just don't understand what is going on, but this does not work as I'd expect (not my code).
Using MSYS2 (installed with msys2-x86_64-20210725.exe) and g++ version 10.3.0, this outputs something like "11:55:59Central Daylight Time", but it should be "11:55:59-0500".
"%z" is supposed to return the offset from UTC. "%Z" is supposed to return the time zone name. Both are outputting the name. On a similar vein, "%F" and "%T" do not work at all.
Compiling on Ubuntu 20.04 with whatever that latest g++ is works as expected.
Links to strftime descriptions for MS and the standard:
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l?view=msvc-160
https://www.cplusplus.com/reference/ctime/strftime/
The text was updated successfully, but these errors were encountered: