mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-03-22 01:55:25 -05:00
Merge 88148a9960 into 12935d5b25
This commit is contained in:
commit
3bc4e27eab
|
|
@ -157,8 +157,15 @@ std::string MovieManager::GetRTCDisplay() const
|
|||
const time_t current_time = CEXIIPL::GetEmulatedTime(m_system, CEXIIPL::UNIX_EPOCH);
|
||||
const tm gm_time = fmt::gmtime(current_time);
|
||||
|
||||
// Use current locale for formatting time, as fmt is locale-agnostic by default.
|
||||
#if FMT_VERSION < 120000 // fmt < 12 still supports locale overload
|
||||
return fmt::format(std::locale{""}, "Date/Time: {:%c}", gm_time);
|
||||
#else
|
||||
// fmt >= 12: no locale overload, fall back to standard library
|
||||
std::ostringstream oss;
|
||||
oss.imbue(std::locale(""));
|
||||
oss << "Date/Time: " << std::put_time(&gm_time, "%c");
|
||||
return oss.str();
|
||||
#endif
|
||||
}
|
||||
|
||||
// NOTE: GPU Thread
|
||||
|
|
|
|||
|
|
@ -297,8 +297,14 @@ static std::string SystemTimeAsDoubleToString(double time)
|
|||
if (!local_time)
|
||||
return "";
|
||||
|
||||
// fmt is locale agnostic by default, so explicitly use current locale.
|
||||
#if FMT_VERSION < 120000 // fmt < 12 still supports locale overload
|
||||
return fmt::format(std::locale{""}, "{:%x %X}", *local_time);
|
||||
#else
|
||||
std::ostringstream oss;
|
||||
oss.imbue(std::locale(""));
|
||||
oss << std::put_time(&*local_time, "%x %X");
|
||||
return oss.str();
|
||||
#endif
|
||||
}
|
||||
|
||||
static std::string MakeStateFilename(int number)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user