diff options
author | Japa <japa4551@protonmail.com> | 2023-04-21 11:18:17 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-21 11:18:17 -0300 |
commit | 92cda68480f3f9bd5b5184314a2dfcdbdda7543b (patch) | |
tree | 5e6b80a5f09810720970447f032b24e71de0cdbb | |
parent | f41426f3945ff60a26b34935bb1b0b43d8de800b (diff) | |
download | PrismLauncher-92cda68480f3f9bd5b5184314a2dfcdbdda7543b.tar.gz PrismLauncher-92cda68480f3f9bd5b5184314a2dfcdbdda7543b.tar.bz2 PrismLauncher-92cda68480f3f9bd5b5184314a2dfcdbdda7543b.zip |
Update launcher/minecraft/MinecraftInstance.cpp
Co-authored-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Signed-off-by: Japa <japa4551@protonmail.com>
-rw-r--r-- | launcher/minecraft/MinecraftInstance.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/launcher/minecraft/MinecraftInstance.cpp b/launcher/minecraft/MinecraftInstance.cpp index f9f4a56b..3ab8b3af 100644 --- a/launcher/minecraft/MinecraftInstance.cpp +++ b/launcher/minecraft/MinecraftInstance.cpp @@ -925,18 +925,10 @@ QString MinecraftInstance::getStatusbarDescription() if(m_settings->get("ShowGameTime").toBool()) { if (lastTimePlayed() > 0) { - struct tm * localTime_format; - localTime_format = localtime(lastLaunchTime()); - - char lastLaunchTime_formatted[13]; - strftime(lastLaunchTime_formatted,13,"%Ex",localTime_format); - - description.append( - tr(", last played at %1 for %2").arg( - lastLaunchTime_formatted, - Time::prettifyDuration(lastTimePlayed()) - ) - ); + QDateTime lastLaunchTime = QDateTime::fromMSecsSinceEpoch(lastLaunch()); + description.append(tr(", last played at %1 for %2") + .arg(QLocale::system().toString(lastLaunchTime, QLocale::ShortFormat)) + .arg(Time::prettifyDuration(lastTimePlayed()))); } if (totalTimePlayed() > 0) { |