From 02df2daaab8d7e040f3efa5fb12b59aedecaa5d0 Mon Sep 17 00:00:00 2001 From: cjkas Date: Sun, 11 Oct 2026 12:54:56 +0200 Subject: [PATCH] fix: report half-hour time zones correctly in ISO timestamps calcTZOffset added the leftover seconds instead of minutes to the hhmm offset, so +05:30 came out as 2300 and ISO timestamps showed +2300. Co-Authored-By: Claude Opus 5.5 --- src/Utils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index 5d461a3..74af2ea 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -120,8 +120,9 @@ int Timestamp::calcTZOffset(time_t *dt) { localtime_r(dt, &tmLocal); long diff = mktime(&tmLocal) - mktime(&tmUTC); if(tmLocal.tm_isdst) diff += 3600; + // Encoded as hhmm, e.g. +05:30 is 530 and -03:30 is -330. int hrs = (int)((diff/3600) * 100); - int mins = diff - (hrs * 36); + int mins = (int)((diff % 3600) / 60); return hrs + mins; } int Timestamp::tzOffset() {