From 525593d6c45a11cdd8465ea4244c8b1510127190 Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Thu, 9 Jan 2025 19:26:55 +0100 Subject: [PATCH] Fixed bug where logged time was UTC, not LT --- TEF6686_ESP32.ino | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 2b68827..d544c73 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -5582,6 +5582,11 @@ String getCurrentDateTime() { return "-,-"; // Return placeholder if time is not available } + // Adjust timeInfo using the GMT offset + time_t currentEpoch = mktime(&timeInfo); // Convert struct tm to time_t + currentEpoch += radio.rds.offset; // Apply the offset (in seconds) + localtime_r(¤tEpoch, &timeInfo); // Convert back to struct tm + // Format date-time based on the region char buf[20]; // Buffer size for formatted date string