Use a DS1307 Real Time Clock chip with the Time library
C++
Latest commit 160fa0d Mar 10, 2016 @PaulStoffregen Use TimeLib.h

readme.txt

Readme file for DS1307RTC Library

The DS1307RTC library is provided to demonstrate the Arduino Time library.

See the TimeRTC example sketches privided with the Time library download for usage