mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-18 08:20:39 +01:00
Add platform-specific 'z' formatter
This commit is contained in:
committed by
Victor Zverovich
parent
be3a3a5aed
commit
5abe9e8266
@@ -49,7 +49,14 @@ std::string system_strftime(const std::string& format, const std::tm* timeptr,
|
||||
os.imbue(loc);
|
||||
facet.put(os, os, ' ', timeptr, format.c_str(),
|
||||
format.c_str() + format.size());
|
||||
#ifdef _WIN32
|
||||
// Workaround a bug in older versions of Universal CRT.
|
||||
auto str = os.str();
|
||||
if (str == "-0000") str = "+0000";
|
||||
return str;
|
||||
#else
|
||||
return os.str();
|
||||
#endif
|
||||
}
|
||||
|
||||
FMT_CONSTEXPR std::tm make_tm(int year, int mon, int mday, int hour, int min,
|
||||
|
||||
@@ -277,7 +277,14 @@ std::wstring system_wcsftime(const std::wstring& format, const std::tm* timeptr,
|
||||
os.imbue(loc);
|
||||
facet.put(os, os, L' ', timeptr, format.c_str(),
|
||||
format.c_str() + format.size());
|
||||
#ifdef _WIN32
|
||||
// Workaround a bug in older versions of Universal CRT.
|
||||
auto str = os.str();
|
||||
if (str == L"-0000") str = L"+0000";
|
||||
return str;
|
||||
#else
|
||||
return os.str();
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(chrono_test, time_point) {
|
||||
|
||||
Reference in New Issue
Block a user