Parse QF100 heartbeat time as WIB
This commit is contained in:
@ -92,12 +92,14 @@ function parseDeviceTime(value: unknown) {
|
|||||||
return new Date().toISOString();
|
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(
|
const parsed = new Date(
|
||||||
Date.UTC(
|
Date.UTC(
|
||||||
Number(match[1]),
|
Number(match[1]),
|
||||||
Number(match[2]) - 1,
|
Number(match[2]) - 1,
|
||||||
Number(match[3]),
|
Number(match[3]),
|
||||||
Number(match[4]),
|
Number(match[4]) - 7,
|
||||||
Number(match[5]),
|
Number(match[5]),
|
||||||
Number(match[6])
|
Number(match[6])
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user