Files created with the Portenta H7 and stored on my SD card have a default created date of 12/31/2097. How can I fix this problem?

#include <SDMMCBlockDevice.h>
#include <FATFileSystem.h>
#include <ArduinoJson.h>
#include "WiFi.h"
#include "Arduino.h"
#include "FTPClient_Generic.h"
#include "SdFat.h"

SDMMCBlockDevice blockDevice;
mbed::FATFileSystem fs("fs");

void initializeSD() {
  if (!initializedSD) {
    int err = fs.mount(&blockDevice);
    if (err) {
      Serial.println("Not mounted successfully");
      while(1);
    }
    Serial.println("Mounted successfully");
    initializedSD = 1;
  }
}

// function to open a file and it returns the address of the file that was opened
FILE* JiBandFileManager::openFile(FILE* file, const char* filePath, const char* mode) {
  initializeSD();
  //SdFile::dateTimeCallback(dateTime);
  file = fopen(filePath, mode);
  if (file == NULL) {
    Serial.println("Error opening file...");
    return NULL;
  } else {
    Serial.println("File opened!");
    return file;
  }
}

// function to close a file that was opened
void JiBandFileManager::closeFile(FILE* file) {
  Serial.println("Closing SD card file...");
  closeFile(file);
  Serial.println("Closing SD file is complete!!!");
}

//Write data to SD
FILE* JiBandFileManager::writeDatatoSDCard(String strData, FILE* fileFile) {
  //convert string data into a pointer to a character
  const char* finalString = (char*)((strData).c_str());
  //loop through all the characters until the end of file and write the character to SD
  for (int i = 0; finalString[i] != '\0'; i++) {
    fputc(finalString[i], fileFile);
  }
  return fileFile;
}

Above is the code I use to write data to the files and the libraries I have included in the program. Could the problem be the libraries I am using or is there something I have omitted or done wrong in my code?

Some of the libraries included above are not used in the code I have uploaded above but are part of the program I am working on.

It seems you are using the sdFat library which knows how to use timestamps.

have you explored how it works ?

I don't really know how the SdFat library works but I ran the example sketch from the "SdFat.h" library and what was printed to the console was "rtc.begin failed". I do not know why exactly. Do you think it might be a compatibility issue? or could it be that my RTC might be broken?