The internal button battery is dead? (If it has one instead of a large value capacitor.)
There is an internal (non-removable) "date/time battery" that keeps your date, language, etc while you swap the main LP-E17 rechargeable battery. If you store your camera with the main battery removed, then that date/time battery will drain and forget your settings.
Peter's comment above is on point. There's a second battery inside the EOS M cameras. It's inside the internal frame and cannot be accessed without almost completely disassembling the camera itself. Whilst frustrating, that's the nature of modern cameras. DSLRs (surprisingly) can allow the user access to this battery for replacement but not Compacts and unfortunately not the EOS M cameras as well.
.
As Peter explained above, the tiny battery is designed specifically for retaining time and date. One other member described the same problem with his own EOS M6 and said his symptoms were the same. In the end, I think he ended up returning the camera because the effort of changing the battery yourself is considerable and would also void any warranty. If you do choose to try this yourself, go to a "tear-down site" that goes through the steps of disassembly and battery replacement. Not sure if the M6 is covered by one yet.
.

The 2nd battery is well hidden on the original EOS M (2012) but is still more easily accessed than more recent EOS M model cameras.
.
All that being said, my original EOS M camera (2012 model) is still running with its original battery. My M6 has not produces any battery related problems. A sure sign of the interior Lithium cell failing is the camera not retaining the date and time. And, as Peter noted, removing the main battery from the camera for too long causes the date/time to be erased after the internal battery runs down over the span of what is presumably several days. Canon actually have specific numbers on this that can be found online from place to place. Each time you place a charged main Lithium battery into your camera before use, a small percentage of power is then fed to the tiny Lithium backup battery. This charges the small one and keeps it "topped up". Removing your main battery for too long will cause the smaller cell to lose power over time.
.
If you are continuing to have trouble with Date/Time on your M, consider returning it. When the camera arrives new in the box the main battery is stored separately for safety reasons and the interior Date/Time is unset. Just leave your battery in the camera when not in use. The charging process is usually under a couple of hours at maximum so if your internal battery dies during the recharge process, it might suggest there's an issue with that internal battery. I'm of the opinion that Canon have very good quality control but it's hard to say how good those tiny backup batteries are since Canon don't make that component themselves.
.
It is possible that your smaller backup battery cell simply needs a push to begin storing power. I think I may have read someplace that these small cells sometimes require the Main battery to be inserted for at least several hours before they can trickle-charge enough energy to sustain themselves. This might be the case with yours. Keep us updated with your progress!
.

The location of the interior 2nd Battery on the original EOS M (2012).
--
Regards,
Marco Nero.