VS2013 C++ Standard Library: wrong timezone format in std::put_time(). - by NoMore

Status : 


Sign in
to vote
ID 808156 Comments
Status Closed Workarounds
Type Bug Repros 1
Opened 11/9/2013 4:10:39 AM
Access Restriction Public


According to standard, std::put_time(&tm, "%z") should output offset from UTC in the ISO 8601 format (e.g. -0430), instead it outputs time zone name, just like std::put_time(&tm, "%Z").
Sign in to post a comment.
Posted by Microsoft on 8/4/2014 at 1:56 PM

Thanks for reporting this bug. We've fixed it, and the fix is available in VS14 CTP1.

While std::put_time() was affected, the actual bug was in the CRT's strftime() machinery, which was overhauled by our CRT maintainer James McNellis. You can read more about his changes here: http://blogs.msdn.com/b/vcblog/archive/2014/06/18/crt-features-fixes-and-breaking-changes-in-visual-studio-14-ctp1.aspx (While that VCBlog post didn't mention %z, I've verified that it was fixed by the overhaul, and that std::put_time() behaves properly now.)

VS14 CTP2 is the latest alpha build, see: http://blogs.msdn.com/b/vcblog/archive/2014/07/08/ctp2-for-visual-studio-quot-14-quot-now-available.aspx

Stephan T. Lavavej
Senior Developer - Visual C++ Libraries
Posted by Microsoft on 11/10/2013 at 6:59 PM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 11/9/2013 at 4:51 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)