[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
1 changed files with 1 additions and 1 deletions

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();