mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-12-13 09:53:06 +00:00
Simplify datetime formatting
This commit is contained in:
parent
b6899a821b
commit
af36b652aa
1 changed files with 1 additions and 11 deletions
|
|
@ -400,17 +400,7 @@ namespace MWGui
|
||||||
struct tm* timeinfo;
|
struct tm* timeinfo;
|
||||||
timeinfo = localtime(&time);
|
timeinfo = localtime(&time);
|
||||||
|
|
||||||
// Use system/environment locale settings for datetime formatting
|
text << std::put_time(timeinfo, "%d.%m.%Y %T") << "\n";
|
||||||
char* oldLctime = setlocale(LC_TIME, nullptr);
|
|
||||||
setlocale(LC_TIME, "");
|
|
||||||
|
|
||||||
const int size=1024;
|
|
||||||
char buffer[size];
|
|
||||||
if (std::strftime(buffer, size, "%x %X", timeinfo) > 0)
|
|
||||||
text << buffer << "\n";
|
|
||||||
|
|
||||||
// reset
|
|
||||||
setlocale(LC_TIME, oldLctime);
|
|
||||||
|
|
||||||
text << "#{sLevel} " << mCurrentSlot->mProfile.mPlayerLevel << "\n";
|
text << "#{sLevel} " << mCurrentSlot->mProfile.mPlayerLevel << "\n";
|
||||||
text << "#{sCell=" << mCurrentSlot->mProfile.mPlayerCell << "}\n";
|
text << "#{sCell=" << mCurrentSlot->mProfile.mPlayerCell << "}\n";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue