Real Time clock module error-DS3231
I am posting a code please try it may be it can help you
    #include &quot;RTClib.h&quot;

RTC_DS3231 rtc;

char daysOfTheWeek[7][12] = {&quot;Sunday&quot;, &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;};

void setup () {
  Serial.begin(57600);

#ifndef ESP8266
  while (!Serial); // wait for serial port to connect. Needed for native USB
#endif

  if (! rtc.begin()) {
    Serial.println(&quot;Couldn't find RTC&quot;);
    Serial.flush();
    abort();
  }

  if (rtc.lostPower()) {
    Serial.println(&quot;RTC lost power, let's set the time!&quot;);
    // When time needs to be set on a new device, or after a power loss, the
    // following line sets the RTC to the date &amp; time this sketch was compiled
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
    // This line sets the RTC with an explicit date &amp; time, for example to set
    // January 21, 2014 at 3am you would call:
     rtc.adjust(DateTime(2020, 10, 19, 10, 13, 0));
  }

  // When time needs to be re-set on a previously configured device, the
  // following line sets the RTC to the date &amp; time this sketch was compiled
  // rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
  // This line sets the RTC with an explicit date &amp; time, for example to set
  // January 21, 2014 at 3am you would call:
  // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
}

void loop () {
    DateTime now = rtc.now();

    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(&quot; (&quot;);
    Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
    Serial.print(&quot;) &quot;);
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();

    Serial.print(&quot; since midnight 1/1/1970 = &quot;);
    Serial.print(now.unixtime());
    Serial.print(&quot;s = &quot;);
    Serial.print(now.unixtime() / 86400L);
    Serial.println(&quot;d&quot;);

    // calculate a date which is 7 days and 30 seconds into the future
    DateTime future (now + TimeSpan(7,12,30,6));

    Serial.print(&quot; now + 7d + 30s: &quot;);
    Serial.print(future.year(), DEC);
    Serial.print('/');
    Serial.print(future.month(), DEC);
    Serial.print('/');
    Serial.print(future.day(), DEC);
    Serial.print(' ');
    Serial.print(future.hour(), DEC);
    Serial.print(':');
    Serial.print(future.minute(), DEC);
    Serial.print(':');
    Serial.print(future.second(), DEC);
    Serial.println();

    Serial.print(&quot;Temperature: &quot;);
    Serial.print(rtc.getTemperature());
    Serial.println(&quot; C&quot;);

    Serial.println();
    delay(3000);
}

Upload the above code and then upload the same code just comment the following part
if (rtc.lostPower()) {
        Serial.println(&quot;RTC lost power, let's set the time!&quot;);
        // When time needs to be set on a new device, or after a power loss, the
        // following line sets the RTC to the date &amp; time this sketch was compiled
        rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
        // This line sets the RTC with an explicit date &amp; time, for example to set
        // January 21, 2014 at 3am you would call:
         rtc.adjust(DateTime(2020, 10, 19, 10, 13, 0));
      }

This will work and even if you plug and unplug it from power the RTC time will not reset