Use fmt::localtime instead of thread-unsafe std::localtime

fmt::localtime is also less awkward to use compared to std::localtime.
This commit is contained in:
Léo Lam
2021-10-15 22:49:13 +02:00
parent 2187f11b08
commit fd7df2ccae
4 changed files with 4 additions and 4 deletions

View File

@ -140,6 +140,6 @@ std::string SettingsHandler::GenerateSerialNumber()
// Must be 9 characters at most; otherwise the serial number will be rejected by SDK libraries,
// as there is a check to ensure the string length is strictly lower than 10.
// 3 for %j, 2 for %H, 2 for %M, 2 for %S.
return fmt::format("{:%j%H%M%S}", *std::localtime(&t));
return fmt::format("{:%j%H%M%S}", fmt::localtime(t));
}
} // namespace Common