@@ -320,7 +320,7 @@ void beginLogging()
320320 {
321321 sprintf (fileName, " %s_%02d%02d%02d_%02d%02d%02d.ubx" , // SdFat library
322322 platformFilePrefix,
323- rtc.getYear () - 2000 , rtc.getMonth (), rtc.getDay (),
323+ rtc.getYear () - 2000 , rtc.getMonth () + 1 , rtc.getDay (), // ESP32Time returns month:0-11
324324 rtc.getHour (), rtc.getMinute (), rtc.getSecond ()
325325 );
326326 }
@@ -401,16 +401,17 @@ void updateDataFileAccess(SdFile *dataFile)
401401{
402402 if (online.rtc == true )
403403 {
404- dataFile->timestamp (T_ACCESS, rtc.getYear (), rtc.getMonth (), rtc.getDay (), rtc.getHour (), rtc.getMinute (), rtc.getSecond ());
405- dataFile->timestamp (T_WRITE, rtc.getYear (), rtc.getMonth (), rtc.getDay (), rtc.getHour (), rtc.getMinute (), rtc.getSecond ());
404+ // ESP32Time returns month:0-11
405+ dataFile->timestamp (T_ACCESS, rtc.getYear (), rtc.getMonth () + 1 , rtc.getDay (), rtc.getHour (), rtc.getMinute (), rtc.getSecond ());
406+ dataFile->timestamp (T_WRITE, rtc.getYear (), rtc.getMonth () + 1 , rtc.getDay (), rtc.getHour (), rtc.getMinute (), rtc.getSecond ());
406407 }
407408}
408409
409410// Update the file create time with date and time obtained from GNSS
410411void updateDataFileCreate (SdFile *dataFile)
411412{
412413 if (online.rtc == true )
413- dataFile->timestamp (T_CREATE, rtc.getYear (), rtc.getMonth (), rtc.getDay (), rtc.getHour (), rtc.getMinute (), rtc.getSecond ());
414+ dataFile->timestamp (T_CREATE, rtc.getYear (), rtc.getMonth () + 1 , rtc.getDay (), rtc.getHour (), rtc.getMinute (), rtc.getSecond ()); // ESP32Time returns month:0-11
414415}
415416
416417// Finds last log
0 commit comments