From 2c4eb82137052218038600a7233a499bf8d5097d Mon Sep 17 00:00:00 2001 From: iota97 Date: Wed, 9 Dec 2020 00:32:55 +0100 Subject: [PATCH] Use system time format on savedata aswell --- UI/SavedataScreen.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/UI/SavedataScreen.cpp b/UI/SavedataScreen.cpp index 2fa6b2d474..47909ea812 100644 --- a/UI/SavedataScreen.cpp +++ b/UI/SavedataScreen.cpp @@ -40,6 +40,7 @@ #include "Core/Loaders.h" #include "Core/SaveState.h" #include "Core/System.h" +#include "Core/HLE/sceUtility.h" class SavedataButton; @@ -47,8 +48,19 @@ std::string GetFileDateAsString(std::string filename) { tm time; if (File::GetModifTime(filename, time)) { char buf[256]; - // TODO: Use local time format? Americans and some others might not like ISO standard :) - strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &time); + switch (g_Config.iDateFormat) { + case PSP_SYSTEMPARAM_DATE_FORMAT_YYYYMMDD: + strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &time); + break; + case PSP_SYSTEMPARAM_DATE_FORMAT_MMDDYYYY: + strftime(buf, sizeof(buf), "%m-%d-%Y %H:%M:%S", &time); + break; + case PSP_SYSTEMPARAM_DATE_FORMAT_DDMMYYYY: + strftime(buf, sizeof(buf), "%d-%m-%Y %H:%M:%S", &time); + break; + default: // Should never happen + return ""; + } return std::string(buf); } return "";