Merge pull request #3610 from liamcottle/fix/timezone-offset

Fix: tz_offset should allow for half hour timezone offsets
This commit is contained in:
Liam Cottle authored and GitHub committed 2026-10-17 15:30:59 +13:00
commit b3d76afd6d
3 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -2192,11 +2192,11 @@ bool MyMesh::handleCommand(const char* command, uint32_t sender_timestamp, char*
}
if (strcmp(command, "get tz.offset") == 0) {
sprintf(reply, "> %d", _prefs.tz_offset);
sprintf(reply, "> %.1f", _prefs.tz_offset);
return true;
}
if (memcmp(command, "set tz.offset ", 14) == 0) {
int8_t tz = atof(&command[14]);
float tz = atof(&command[14]);
if (tz < -12 || tz > 14) {
strcpy(reply, "Error, must be from -12 to +14");
} else {
+1 -1
View File
@@ -47,7 +47,7 @@ public:
uint8_t agc_reset_interval = 0; // secs / 4
char default_scope_name[31];
uint8_t default_scope_key[16];
int8_t tz_offset = 0;
float tz_offset = 0;
#ifdef ENABLE_WIFI_INTERFACE
#ifndef WIFI_SSID
#define WIFI_SSID ""
+1 -1
View File
@@ -295,7 +295,7 @@ public:
#ifdef UI_SHOW_CLOCK
display.setTextSize(3);
uint32_t now = _rtc->getCurrentTime();
now += (int32_t)_node_prefs->tz_offset * 3600;
now += (int32_t)(_node_prefs->tz_offset * 3600);
DateTime dt (now);
sprintf(tmp, "%02d:%02d", dt.hour(), dt.minute());
display.drawTextCentered(display.width() / 2, 60, tmp);