From ee60e8dc740c2cfac6cb208d585b81872b4e070c Mon Sep 17 00:00:00 2001 From: Edgar W Date: Sat, 3 Jan 2026 14:51:34 +0100 Subject: [PATCH] feat: add getters for day of the month and month number --- ntp_client_plus.cpp | 20 ++++++++++++++++++++ ntp_client_plus.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/ntp_client_plus.cpp b/ntp_client_plus.cpp index 451bde3..2dadd9f 100644 --- a/ntp_client_plus.cpp +++ b/ntp_client_plus.cpp @@ -314,6 +314,26 @@ unsigned int NTPClientPlus::getDayOfWeek() return this->_dayOfWeek; } +/** + * @brief Getter for day of the month + * + * @return unsigned int + */ +unsigned int NTPClientPlus::getDayOfMonth() +{ + return this->_dateDay; +} + +/** + * @brief Getter for the month number + * + * @return unsigned int + */ +unsigned int NTPClientPlus::getMonthNumber() +{ + return this->_dateMonth; +} + /** * @brief Function to calc current year * diff --git a/ntp_client_plus.h b/ntp_client_plus.h index 847306c..7060f2c 100644 --- a/ntp_client_plus.h +++ b/ntp_client_plus.h @@ -33,6 +33,8 @@ class NTPClientPlus{ String getFormattedDate(); void calcDate(); unsigned int getDayOfWeek(); + unsigned int getDayOfMonth(); + unsigned int getMonthNumber(); unsigned int getYear(); bool isLeapYear(unsigned int year); int getMonth(int dayOfYear);