GetISO8601CurrentDateTime(): use %z format on msys2 build ucrt64
(however ucrt64 on msys2 has an issue (crash) with json validator and can be used only for tests)
This commit is contained in:
parent
aa3e298890
commit
df11673f86
|
@ -663,10 +663,11 @@ char* GetLine( FILE* File, char* Line, int* LineNum, int SizeLine )
|
||||||
|
|
||||||
wxString GetISO8601CurrentDateTime()
|
wxString GetISO8601CurrentDateTime()
|
||||||
{
|
{
|
||||||
// on msys2 the %z format (offset from UTC in the ISO 8601 format, e.g. -0430) does not work,
|
// on msys2 variant mingw64, in fmt::format the %z format
|
||||||
// and is in fact %Z (locale-dependent time zone name or abbreviation) which breaks our date.
|
// (offset from UTC in the ISO 8601 format, e.g. -0430) does not work,
|
||||||
// so do not use it (until %z works)
|
// and is in fact %Z (locale-dependent time zone name or abbreviation) and breaks our date.
|
||||||
#ifdef __MINGW32__
|
// However, on msys2 variant ucrt64, it works (this is not the same code in fmt::format)
|
||||||
|
#if defined(__MINGW32__) && !defined(_UCRT)
|
||||||
return fmt::format( "{:%FT%T}", fmt::localtime( std::time( nullptr ) ) );
|
return fmt::format( "{:%FT%T}", fmt::localtime( std::time( nullptr ) ) );
|
||||||
#else
|
#else
|
||||||
return fmt::format( "{:%FT%T%z}", fmt::localtime( std::time( nullptr ) ) );
|
return fmt::format( "{:%FT%T%z}", fmt::localtime( std::time( nullptr ) ) );
|
||||||
|
|
Loading…
Reference in New Issue