mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-27 20:36:51 +01:00
Assume timezone UTC for BLE time protocol
BLE protocol only sends a UTC offset which combines the TZ with DST, if we take a local timezone as a base and add a raw offset with DST included, DST might be added again. This is to fix problems with recorded data on Huami devices where we cannot know in which timezone data was recorded - only the offset, where we do not know if a part of it is DST.
This commit is contained in:
parent
9222c6700e
commit
e5caf78fb0
@ -118,7 +118,9 @@ public class BLETypeConversions {
|
||||
);
|
||||
|
||||
if (value.length > 7) {
|
||||
TimeZone timeZone = TimeZone.getDefault();
|
||||
/* when we get a timezone offset via BLE, we cannot know which timeszone this is (only its offset), so
|
||||
set to UTC which does not use DST to prevent bugs when setting the raw offset below */
|
||||
TimeZone timeZone = TimeZone.getTimeZone("UTC");
|
||||
timeZone.setRawOffset(value[7] * 15 * 60 * 1000);
|
||||
timestamp.setTimeZone(timeZone);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user