How paulstoffregen/time works
Arduino Time is a compact timekeeping library: a sketch reads or sets Unix-style time through the public API, while the runtime advances its clock and can periodically synchronize through a callback. The core also converts between timestamps and calendar fields and provides date-name strings. README-documented RTC, NTP, GPS, and serial examples demonstrate interchangeable time sources; their implementation details were not sampled, so those connections are shown as documented rather than source-verified.
Main entry points: TimeLib.h Time API · Time.cpp Clock and conversions · TimeRTC.ino RTC example · TimeNTP.ino NTP example
Components 9
Time library
- Time API
TimeLib.h - Clock and conversions
Time.cpp - Date strings
DateStrings.cpp
Time-source examples
- RTC example
examples/TimeRTC/TimeRTC.ino - NTP example
examples/TimeNTP/TimeNTP.ino - GPS example
examples/TimeGPS/TimeGPS.ino - Serial example
examples/TimeSerial/TimeSerial.ino
Other components
- Arduino sketch
- External time sources
Connections 13
- Arduino sketch → Time API: uses
Readme.md - Time API → Clock and conversions: exposes
Time.cpp - Time API → Date strings: exposes
DateStrings.cpp - Clock and conversions → Clock and conversions: reads clock ticks
Time.cpp - Clock and conversions → External time sources: calls sync provider
Time.cpp - RTC example → Time API: synchronizes through
Readme.md - NTP example → Time API: synchronizes through
Readme.md - GPS example → Time API: synchronizes through
Readme.md - Serial example → Time API: synchronizes through
Readme.md - External time sources → RTC example: includes RTC
Readme.md - External time sources → NTP example: includes NTP
Readme.md - External time sources → GPS example: includes GPS
Readme.md - External time sources → Serial example: includes serial
Readme.md