Fixed bug where logged time was UTC, not LT

This commit is contained in:
Sjef Verhoeven PE5PVB
2025-01-09 19:26:55 +01:00
parent c34a3d4c68
commit 525593d6c4

View File

@@ -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(&currentEpoch, &timeInfo); // Convert back to struct tm
// Format date-time based on the region
char buf[20]; // Buffer size for formatted date string