-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Formatting a std::chrono::system_clock renders in local time, not in UTC #3199
Comments
The first change has already been applied. Could you by any chance submit the second one as a PR? |
Last day of work for this year, so had a few spare minutes to get this done finally. |
Apologies for the unprompted reply. Currently on holidays in the United States without any ability to write code, which is deliberate. Glad you figured out some way to merge it, will look into your remaining ask when I return to Europe in January. |
@Jan-Otto-Bakkland-Volue, this doesn't look related to {fmt}. Please check cppreference or ask on StackOverflow. |
For some time now we've had this in our cmake, so I figured time to upstream this:
Two things are changed here:
The
Duration
template parameter isn't passed through, breaking formatting time points with non-default duration types.Formatting system clock time points is to UTC, not to localtime, as system clock specifically represents UTC not local time (if you want a local time point, use
chrono::local_t
). Microsoft's implementation ofstd::format
agrees with this formatting interpretation i.e. system clocks format to UTC strings, local clocks format to local strings.The text was updated successfully, but these errors were encountered: