Set DATE on .txt file with SD module

Hi, I am using an ARDUINO Nano 328p 5V, a DS3231 as a RTC and the micro sd module. I'm wondering if it's possible to set the date of the file. Ex: Today it's 03/06/2020 so in the sd module the file would be: 03/06/2020.txt and if it's 04/06/2020, a new file.

Thanks.

I don't think you really need it but anyway:

#include <SD.h>
#include <SPI.h>
#include <DS3231.h>
File myFile;
DS3231  rtc(SDA, SCL);
int pinCS = 10;
void setup() {
   
  Serial.begin(9600);
  pinMode(pinCS, OUTPUT);
 
  // SD Card Initialization
  if (SD.begin())
  {
    Serial.println("SD card is ready to use.");
  } else
  {
    Serial.println("SD card initialization failed");
    return;
  }
  rtc.begin();   
}
void loop() {
  Serial.print(rtc.getTimeStr());
  Serial.print(",");
  Serial.println(int(rtc.getTemp()));
 
  myFile = SD.open("test.txt", FILE_WRITE);
  if (myFile) {   
    myFile.print(rtc.getTimeStr());
    myFile.print(",");   
    myFile.println(int(rtc.getTemp()));
    myFile.close(); // close the file
  }
  // if the file didn't open, print an error:
  else {
    Serial.println("error opening test.txt");
  }
  delay(3000);
}

I dont know if you could create a file called 03/06/2020.txt in Arduino as its not valid in Windows, so I would not bother.

But it should be possible to create a file called say 030620.txt, the SD.h library you are using will limit you to DOS 8.3 filenames.

srnet:
But it should be possible to create a file called say 030620.txt, the SD.h library you are using will limit you to DOS 8.3 filenames.

Oh, and how do I make it? Because I’ve been trying to do it and I can’t figure it out.