Fix incorrect time format being used sometimes when not in UTC timezone, add day of month to "previous year" time format
This commit is contained in:
parent
2d838087b5
commit
cc93479c4b
@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user