1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 12:56:49 +01:00

[Huawei] Fix TimeZone offset calculation

This commit is contained in:
Damien 'Psolyca' Gaignon 2024-04-15 21:37:57 +02:00
parent f0a9ab7f98
commit 84070dd0ba
No known key found for this signature in database
GPG Key ID: 9E9404E5D9E11843

View File

@ -51,7 +51,7 @@ public class HuaweiUtil {
byte[] id = now.getTimeZone().getID().getBytes();
return ByteBuffer.allocate(6 + id.length)
.putInt((int)(now.getTimeInMillis() / 1000))
.put((byte)(zoneRawOffset < 0 ? (zoneRawOffset / 3600 + 128) : zoneRawOffset / 3600) )
.put((byte)(zoneRawOffset < 0 ? (-zoneRawOffset / 3600 + 128) : zoneRawOffset / 3600) )
.put((byte)(zoneRawOffset / 60 % 60))
.put(id)
.array();