All notable changes to this project are documented in this file.
The format follows Keep a Changelog and the project adheres to Semantic Versioning.
ESPDateConfig::usePSRAMBuffersto prefer PSRAM-backed allocation for ESPDate-owned text/state buffers (timezone, NTP server, scoped TZ restore state) throughESPBufferManager, with automatic fallback to normal heap.- Multi-server NTP config support in
ESPDateConfigviantpServer(primary),ntpServer2(secondary), andntpServer3(tertiary), with empty values ignored and compacted before callingconfigTzTime. isDstActivehelper to detect whether daylight saving time is in effect using a provided POSIX TZ string, the stored TZ config, or the current system TZ.- Moon phase calculation helpers returning phase angle and illumination for any
DateTime(ornow()). - Local time helpers:
nowLocal()plustoLocal(DateTime[, tz])expose broken-out local components and UTC offset for debugging sunrise/sunset and DST handling. - Documented the recommended UTC storage + local UI workflow (convert user-picked local times back to UTC with
fromLocal/parseDateTimeLocal). setNtpSyncCallback(...)so applications can optionally react when SNTP reports a successful sync.setNtpSyncCallback(const NtpSyncCallable&)overload so member methods can be registered viastd::bind.syncNTP()to immediately trigger a new SNTP sync using the configured NTP server list.ntpSyncIntervalMsconfig field plussetNtpSyncIntervalMs(...)runtime setter to override SNTP sync interval when runtime support is available.- Internal last-sync tracking plus
hasLastNtpSync()/lastNtpSync()getters. - String formatting helpers for
DateTime/LocalDateTimewith buffer-based APIs plusstd::stringconvenience wrappers (nowUtcString,nowLocalString, etc.). - Added
lastNtpSyncStringLocal/Utchelpers (buffer +std::string) to serialize the last NTP sync timestamp directly. - Added direct
DateTime::utcString/localStringandLocalDateTime::localStringmethods so standalone values can be formatted without anESPDateround-trip. - Added focused example sketches:
examples/string_helpersandexamples/ntp_sync_tracking. - Added additive NTP sync listeners via
addNtpSyncListener(...)/removeNtpSyncListener(...)so multiple consumers can observe sync events without replacing the primary callback.
- Replaced the
ESPDateConfigconstructor with an explicitinit(const ESPDateConfig&)so configuration happens after the Arduino runtime is alive, avoiding early SNTP watchdog resets on some boards. ESPDateConfignow accepts up to three NTP servers; when at least one is provided alongsidetimeZone,initcallsconfigTzTimeto set the TZ and bootstrap SNTP automatically.
- Restored builds by adding the missing internal
utils.hhelpers referenced by the sun/scheduler code paths. - Resolved ambiguous
setNtpSyncCallback(...)overload selection for non-capturing lambdas on ESP32 toolchains. - Added
ESPDate::deinit()and destructor cleanup so a destroyed active instance releases SNTP callback ownership instead of leaving stale global callback state. - Sunrise/sunset now resolve UTC results from the event's local wall-clock time instead of the query timestamp offset, which keeps DST transition days stable before and after the clock change.
- CI now pins PIOArduino Core to
v6.1.19and installs the ESP32 platform viapio pkg install, restoring PlatformIO compatibility with the currentplatform-espressif32package.
1.0.1 - 2025-12-09
- Sunrise/sunset helpers with optional constructor config (lat/lon/TZ), DST-aware TZ-string support, explicit parameter overloads, and
isDayconvenience checks (with optional offsets). - Unity smoke tests under
test/test_esp_dateto cover arithmetic, formatting, parsing, and sun-cycle flows on-device. monthName(int|DateTime)helper to return friendly month strings.- Sun cycle example sketch under
examples/sun_cycle. - Minute-level equality helpers:
isEqualMinutes/isEqualMinutesUtc. - Documented both installation paths (manual zip drop-in and PlatformIO
lib_depsGitHub URL) in the README Getting Started section. - Convenience constructors (
fromUtc,fromLocal), start-of-year helpers, and scheduler-friendly helpers (nextDailyAtLocal,nextWeekdayAtLocal) to simplify consumer code.
- Seeded the CI Arduino CLI setup with the ESP32 board manager URL so core installs succeed on clean runners.
- Clarified date arithmetic/difference semantics in README and downgraded the
time_twidth check to a warning for 32-bit toolchains.
1.0.0 - 2025-12-07
- Introduced the
DateTimevalue type backed by epoch seconds with UTC calendar accessors. - Added arithmetic helpers for seconds, minutes, hours, days, months, and years, plus calendar boundaries (
startOfDay*,endOfMonth*) in UTC and local time. - Implemented formatting helpers (ISO-8601, datetime, date, time, and custom patterns) and parsing for ISO-8601 UTC or local
YYYY-MM-DD HH:MM:SS. - Included comparison/difference helpers (
isBefore,isAfter,isEqual,isSameDay,differenceIn*) and convenience setters likesetTimeOfDayLocal. - Added a basic Arduino sketch demonstrating common flows.
- Added Arduino and PlatformIO metadata, CMake scaffolding, CI/release workflows, and repo hygiene files (code of conduct, license, changelog).
- Authored the README describing goals, feature overview, examples, gotchas, and ESPToolKit links.