From cc93479c4b1ae1d6caa0566c88c776d541601095 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Mon, 31 Dec 2018 21:49:44 -0500 Subject: [PATCH] Fix incorrect time format being used sometimes when not in UTC timezone, add day of month to "previous year" time format --- src/Format.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Format.cpp b/src/Format.cpp index d06fc253e..8008c9ff7 100644 --- a/src/Format.cpp +++ b/src/Format.cpp @@ -52,12 +52,12 @@ ByteString format::UnixtimeToDate(time_t unixtime, ByteString dateFormat) ByteString format::UnixtimeToDateMini(time_t unixtime) { time_t currentTime = time(NULL); - struct tm currentTimeData = *localtime(¤tTime); - struct tm timeData = *localtime(&unixtime); + struct tm currentTimeData = *gmtime(¤tTime); + struct tm timeData = *gmtime(&unixtime); if(currentTimeData.tm_year != timeData.tm_year) { - return UnixtimeToDate(unixtime, "%b %Y"); + return UnixtimeToDate(unixtime, "%d %b %Y"); } else if(currentTimeData.tm_mon != timeData.tm_mon || currentTimeData.tm_mday != timeData.tm_mday) {