Changed the file date time adjustements
This commit is contained in:
parent
5611f59575
commit
3e193233b4
@ -841,9 +841,10 @@ class FTPServer : public TCPServer<T>
|
|||||||
if (!fileOrDir) //No more files in the directory
|
if (!fileOrDir) //No more files in the directory
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//We try to retrieve the last modification date
|
//We try to retrieve the last modification date and we remove one day and one hour
|
||||||
const time_t fileModifDate = fileOrDir.getLastWrite();
|
const time_t fileModifDate = fileOrDir.getLastWrite() - 60*60;
|
||||||
struct tm *timeP = localtime(&fileModifDate);
|
struct tm *timeP = localtime(&fileModifDate);
|
||||||
|
|
||||||
//We get the month's three letter abbreviation
|
//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 ...
|
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<T>
|
|||||||
fileOrDir.isDirectory() ? 0 : fileOrDir.size(),
|
fileOrDir.isDirectory() ? 0 : fileOrDir.size(),
|
||||||
(char *)&monthAbbreviation,
|
(char *)&monthAbbreviation,
|
||||||
dateTimeFormater(zero_prepended[0],timeP->tm_mday,'0'),
|
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'),
|
dateTimeFormater(zero_prepended[2],timeP->tm_min,'0'),
|
||||||
fileOrDir.name());
|
fileOrDir.name());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user