The RTC does not implement daylight savings, and the SDK makes no attempt to translate between hardware and local time. If something is happening at the wrong hour, I would check the hour field, rather than the month.
The POSIX date command has two formats for day of week:%w is the normal one, and the one that agrees with Pico RTC. %u is for use with ISO week numbering (%V).
(The best option for automatic DST is to set the hardware to a standard time, UTC or a fixed offset, which you can obtain from the host using TZ=UTC+8 date. Then add logic to your code to correct the hour only in software. In your case is it easier just to reboot the Pico whenever the clocks change, and have it pick up the new local time from the host.)
The POSIX date command has two formats for day of week:
Code:
%u day of week (1..7); 1 is Monday %w day of week (0..6); 0 is Sunday
(The best option for automatic DST is to set the hardware to a standard time, UTC or a fixed offset, which you can obtain from the host using TZ=UTC+8 date. Then add logic to your code to correct the hour only in software. In your case is it easier just to reboot the Pico whenever the clocks change, and have it pick up the new local time from the host.)
Statistics: Posted by jojopi — Sun Mar 03, 2024 4:12 pm