32#if defined(ARDUINO_ARCH_ESP32)
64 Serial.print(
"RTC Model:");
79 Serial.print(
"[RTC ]:");
90 Serial.print(
"[UNIX]:");
91 Serial.print(
" Year :");
printInt(info.tm_year + 1900);
92 Serial.print(
" Month:");
printInt(info.tm_mon + 1);
93 Serial.print(
" Day :");
printInt(info.tm_mday);
94 Serial.print(
" Hour:");
printInt(info.tm_hour);
95 Serial.print(
" Minute:");
printInt(info.tm_min);
96 Serial.print(
" Sec :");
printInt(info.tm_sec);
101 Serial.print(
"Set Unix Time:");
105 utc_tm.tm_year = 2025 - 1900;
116 Serial.print(
"Set UTC time to time zone offset 8 hours:");
120 utc_tm.tm_year = 2025 - 1900;
142 size_t written = strftime(
buf, 64,
"%A, %B %d %Y %H:%M:%S", &timeinfo);
148 written = strftime(
buf, 64,
"%b %d %Y %H:%M:%S", &timeinfo);
153 written = strftime(
buf, 64,
"%A, %d. %B %Y %I:%M%p", &timeinfo);
165 Serial.begin(115200);
170 Serial.println(
"Only supported on the esp32 platform");
uint8_t getMinute() const
uint8_t getSecond() const
void setDateTime(RTC_DateTime datetime) override
Set the RTC date and time.
const char * getChipName() override
Get RTC chip name.
bool begin(SensorCommCustom::CustomCallback callback)
Initialize device using a custom transport callback.
RTC_DateTime getDateTime() override
Read the RTC date and time.
void convertUtcToTimezone(int &year, int &month, int &day, int &hour, int &minute, int &second, int timezoneOffsetSeconds)
Convert UTC time represented by individual values to the time in the specified timezone.