GetISO8601CurrentDateTime(): workaround on msys2 to fix a format issue.
on msys2 the format %z is seen as %Z, which is not acceptable here. so %z format is removed on msys2
This commit is contained in:
parent
0ecf5033e2
commit
0741471092
|
@ -663,7 +663,14 @@ 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,
|
||||||
|
// and is in fact %Z (locale-dependent time zone name or abbreviation) which breaks our date.
|
||||||
|
// so do not use it (until %z works)
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
return fmt::format( "{:%FT%T}", fmt::localtime( std::time( nullptr ) ) );
|
||||||
|
#else
|
||||||
return fmt::format( "{:%FT%T%z}", fmt::localtime( std::time( nullptr ) ) );
|
return fmt::format( "{:%FT%T%z}", fmt::localtime( std::time( nullptr ) ) );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue