RTClib
The RTC library is a collection of tools to deal with dates and times, and to interface with RTC chips, clock radio modules, etc.
Download as ZIP archive, browse the repository at source:RTClib, or track changes via subversion using:
svn co svn://svn.jeelabs.org/jeelabs/trunk/libraries/RTClib
There's also a fork of this library on GitHub, by Adafruit.
Use Arduino IDE version 18 or later, and put the "RTClib" folder inside a "libraries" folder next to your sketches.
Definitions in source:RTClib/RTClib.h
Examples
Credits
RTClib was written from scratch by Jean-Claude Wippler at JeeLabs.
The idea to set the date and time from the __DATE__ and __TIME__ string macros in C was suggested by Limor Fried at Adafruit.