What it is: The DS3231 is a very accurate real-time clock (±2 ppm, about a minute a year) with a coin-cell backup so it keeps time even when your project is unplugged. It also exposes its internal temperature, which it uses to stay accurate.
How it works: I2C device at 0x68. On first upload the sketch sets the clock to your computer's compile time; after that the coin cell keeps it running. The library returns the date, time and chip temperature.
Wiring (shared I2C bus with the OLED):
DS3231 SDA -> GPIO4
DS3231 SCL -> GPIO5
DS3231 VCC -> 3V3
DS3231 GND -> GND
OLED VCC=3V3, GND=GND, SDA=GPIO4, SCL=GPIO5
Libraries: "RTClib" by Adafruit (installs "Adafruit BusIO"), plus "Adafruit SSD1306" and "Adafruit GFX Library".
On screen / Serial: the current time (HH:MM:SS), the date, and the chip temperature in °C.
Gotchas: Insert a CR2032 backup battery or it forgets the time on power loss. The sketch sets the time to the compile moment only when it detects a power loss — to force a reset, uncomment the rtc.adjust line. Cheap modules sometimes try to recharge a non-rechargeable CR2032; that's a known quirk but harmless for hobby use.