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

@ -739,7 +739,7 @@ static std::string GenerateScreenshotName()
const std::time_t cur_time = std::time(nullptr);
const std::string base_name =
fmt::format("{}_{:%Y-%m-%d_%H-%M-%S}", path_prefix, *std::localtime(&cur_time));
fmt::format("{}_{:%Y-%m-%d_%H-%M-%S}", path_prefix, fmt::localtime(cur_time));
// First try a filename without any suffixes, if already exists then append increasing numbers
std::string name = fmt::format("{}.png", base_name);