Fixed timezone issue in DLMS timestamps

This commit is contained in:
Gunnar Skjold
2024-06-27 10:54:22 +02:00
parent 81b3aacc4d
commit e38a064928

View File

@@ -24,7 +24,7 @@ time_t decodeCosemDateTime(CosemDateTime timestamp) {
time_t time = makeTime(tm);
int16_t deviation = ntohs(timestamp.deviation);
if(deviation >= -720 && deviation <= 720) {
time -= deviation * 60;
time += deviation * 60;
}
return time;
}