Problem on write data to sd card

Hi guys i'm new on the world of arduino...
so I have a problem with my project, i created datalogger with rtc and power sensor. I already created the system and it works, but i want to make the writing to sd card only happen on the 1st date every month. I can only think to set the delay, but not all of month consist 30 days so i kind of stuck right here. Hope somebody can help me with this problem. Here's my code so far

#include <SD.h>
#include <SPI.h>
#include <DS3231.h>
#include <PZEM004T.h>

PZEM004T* pzem;
IPAddress ip(192,168,1,1);
File myFile;
DS3231  rtc(SDA, SCL);
int pinCS = 53; // Pin 10 on Arduino Uno
void setup() {
    
  Serial.begin(9600);
  pinMode(pinCS, OUTPUT);
  while(!Serial) { }
  Serial.begin(9600);

  while(!Serial3) { }
  pzem = new PZEM004T(&Serial3);
  pzem->setAddress(ip);
  
  // 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() {
  float e = pzem->energy(ip);
  Serial.print(rtc.getDateStr());
  Serial.print(",");
  if(e >= 0.0){ Serial.print(e);Serial.println("Wh; "); }
  myFile = SD.open("test.txt", FILE_WRITE);
  if (myFile) {    
    myFile.print(rtc.getDateStr());
    myFile.print(",");    
    myFile.println(float(e));
    myFile.close(); // close the file
    delay(3000);
  }
}

I can only think to set the delay

Having the Arduino do nothing for an entire month is just wrong.

You have a real time clock. That means that you could know the day of the month. When the day is 1, write to the card.

I hope your Arduino doesn't loose power anytime during the month.

PaulS:
Having the Arduino do nothing for an entire month is just wrong.

thanks for the replied.....
i try to created smart power meter, so the arduino read power,voltage and current continously. I try to save the data from the 1st date because in my country, an electricity bills is created based on the 1st date.

PaulS:
You have a real time clock. That means that you could know the day of the month. When the day is 1, write to the card.

How to make an order to do that? i try to search the source code but couldnt find any