Create timestamps of files in M5Stack

Hi
I'm not sure, if I am right here. I have a M5Core2 and I want to write files to sd card. How can I set create-date and modify-date?
I have this code:

#include <M5Core2.h>

bool written = false;

void setup() {
  M5.begin(true, true, true, true);
  Serial.println("Ready");
}

void loop() {
  if(!written) {
    writeFile(SD, "/hello.txt", "Hello world");
    written = true;
  }
}

void writeFile(fs::FS &fs, const char * path, const char * message){
    Serial.printf("Writing file: %s\n", path);

    File file = fs.open(path, FILE_WRITE);
    if(!file){
        Serial.println("Failed to open file for writing");
        return;
    }
    if(file.print(message)){
        Serial.println("File written");
    } else {
        Serial.println("Write failed");
    }
}

Even with M5.Rtc.SetData(&DateStruct); it does not work. Can anyone help, please?
Thank you
Marco

With this code it works:
struct tm tm;
tm.tm_year = 2020 - 1900;
tm.tm_mon = 11 - 1;
tm.tm_mday = 13;
tm.tm_hour = 23;
tm.tm_min = 59;
tm.tm_sec = 42;
time_t t = mktime(&tm);
struct timeval now = { .tv_sec = t };
settimeofday(&now, NULL);