In the Code Example Section of this forum, look for

Easy and Accurate Clocks without RTC IC

The second attached program in this post does almost exactly what you want. Only simple changes are needed to make it match your goals.

Good Luck,


Paul Borgmeier
Salt Lake City, Utah
USA