Parse QF100 heartbeat time as WIB

This commit is contained in:
Wira Basalamah
2026-06-07 03:01:53 +07:00
parent e3d7e60ff3
commit ef23b09fb7

View File

@ -92,12 +92,14 @@ function parseDeviceTime(value: unknown) {
return new Date().toISOString();
}
// QF100 firmware sends NTP-local WIB time (UTC+7) in YYYYMMDDHHMMSS.
// Store timestamps in UTC so heartbeat age and last-seen calculations stay correct.
const parsed = new Date(
Date.UTC(
Number(match[1]),
Number(match[2]) - 1,
Number(match[3]),
Number(match[4]),
Number(match[4]) - 7,
Number(match[5]),
Number(match[6])
)