From 2b18f0b4690fbd17a753523c2c27c60902159530 Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Tue, 19 Feb 2019 18:31:06 +0100 Subject: [PATCH] Vita: ensure the displayed time is in the local timezone --- menu/menu_driver.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/menu/menu_driver.c b/menu/menu_driver.c index f181a767a3b..066630be953 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -30,6 +30,10 @@ #include #endif +#ifdef VITA +#include +#endif + #ifdef HAVE_DISCORD #include "discord/discord.h" #endif @@ -356,7 +360,17 @@ void menu_display_timedate(menu_display_ctx_datetime_t *datetime) if (!datetime) return; +#ifdef VITA + SceRtcTick tick; + SceDateTime time_local; + + sceRtcGetCurrentTick(&tick); + sceRtcConvertUtcToLocalTime(&tick, &tick); + sceRtcSetTick(&time_local, &tick); + sceRtcGetTime_t(&time_local, &time_); +#else time(&time_); +#endif setlocale(LC_TIME, "");