diff --git a/src/app/FTPServer.h b/src/app/FTPServer.h index e6547e4..f1a380f 100644 --- a/src/app/FTPServer.h +++ b/src/app/FTPServer.h @@ -841,9 +841,10 @@ class FTPServer : public TCPServer if (!fileOrDir) //No more files in the directory break; - //We try to retrieve the last modification date - const time_t fileModifDate = fileOrDir.getLastWrite(); + //We try to retrieve the last modification date and we remove one day and one hour + const time_t fileModifDate = fileOrDir.getLastWrite() - 60*60; struct tm *timeP = localtime(&fileModifDate); + //We get the month's three letter abbreviation uint32_t monthAbbreviation = monthNumTo3LetterAbbreviation(timeP->tm_mon + 1); //+1 because in the tm struct, month goes from 0 to 11 ... @@ -858,7 +859,7 @@ class FTPServer : public TCPServer fileOrDir.isDirectory() ? 0 : fileOrDir.size(), (char *)&monthAbbreviation, dateTimeFormater(zero_prepended[0],timeP->tm_mday,'0'), - dateTimeFormater(zero_prepended[1],!timeP->tm_hour ? 23 : timeP->tm_hour-1 ,'0'), + dateTimeFormater(zero_prepended[1],timeP->tm_hour ,'0'), dateTimeFormater(zero_prepended[2],timeP->tm_min,'0'), fileOrDir.name());