1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Fix possible uncaught exception

This commit is contained in:
Ivan Savenko 2023-08-23 22:46:15 +03:00
parent dd8a59fa86
commit 26bddbac44

View File

@ -10,7 +10,14 @@ namespace vstd
{
std::tm tm = *std::localtime(&dt);
std::stringstream s;
s.imbue(std::locale(""));
try
{
s.imbue(std::locale(""));
}
catch(const std::runtime_error & e)
{
// locale not be available - keep default / global
}
s << std::put_time(&tm, "%x %X");
return s.str();
}