This video shows an example of using a real-time clock based on the ds3231 schema:
1) choosing the right library and connecting it
2) example for setting the date and time
3) an example for getting the date and time
For example, I output data from the real-time clock on the oled display (0.96 '). This display has a matrix size of 128x64 pixels and is connected via the spi interface, but it provides a soldering of 3 components for the robot on the IIc (i2c) interface.