Skip to content

Fix timezone offset formatting in device timestamps - #2664

Open
Firat17aze wants to merge 2 commits into
xoseperez:devfrom
Firat17aze:fix/format-timezone-offsets
Open

Firat17aze wants to merge 2 commits into
xoseperez:devfrom
Firat17aze:fix/format-timezone-offsets

Conversation

@Firat17aze

@Firat17aze Firat17aze commented Oct 9, 2026 •

Copy link
Copy Markdown

A device configured for UTC-05:00 currently produces a timestamp ending in +0-5:00. Negative fractional offsets also retain negative hour/minute components, and values of 9 omit the leading zero. These strings appear in the device time, scheduler and WebSocket output.

Choose the sign from the complete offset, format its absolute hours/minutes, and pad values below 10. Add 12 explicit public formatter cases, including negative, fractional, single-digit and cross-midnight offsets.

Validation: the new regression fails on the original source. 13 of 14 CTest suites pass with AddressSanitizer, including the new datetime suite. The unchanged Tuya suite reports a container-overflow at tuya_transport.h:184, also reproduced with the original datetime source. The fetched Arduino mock dependency needed local-only adaptations for macOS ARM (inert interrupt getters and a weak function in place of an ELF alias); these are excluded from this PR. A full NodeMCU Lolin ESP8266 firmware build passes on espressif8266 4.2.1. No physical hardware tested.

LLMs were used for review and code generation in some parts of this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant