diff --git a/bundles/org.openhab.binding.mercedesme/src/main/java/org/openhab/binding/mercedesme/internal/handler/VehicleHandler.java b/bundles/org.openhab.binding.mercedesme/src/main/java/org/openhab/binding/mercedesme/internal/handler/VehicleHandler.java index 50879587880..313afc3de13 100644 --- a/bundles/org.openhab.binding.mercedesme/src/main/java/org/openhab/binding/mercedesme/internal/handler/VehicleHandler.java +++ b/bundles/org.openhab.binding.mercedesme/src/main/java/org/openhab/binding/mercedesme/internal/handler/VehicleHandler.java @@ -14,6 +14,7 @@ package org.openhab.binding.mercedesme.internal.handler; import static org.openhab.binding.mercedesme.internal.Constants.*; +import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Arrays; @@ -954,7 +955,7 @@ public class VehicleHandler extends BaseThingHandler { if (vas != null && !Utils.isNil(vas)) { // proto weekday starts with MONDAY=0, java ZonedDateTime starts with MONDAY=1 long estimatedWeekday = Utils.getInt(vas) + 1; - ZonedDateTime storedZdt = endDateTimeType.getZonedDateTime(); + ZonedDateTime storedZdt = endDateTimeType.getZonedDateTime(ZoneId.systemDefault()); long storedWeekday = storedZdt.getDayOfWeek().getValue(); // check if estimated weekday is smaller than stored // estimation Monday=1 vs. stored Saturday=6 => (7+1)-6=2 days ahead diff --git a/bundles/org.openhab.binding.mercedesme/src/main/java/org/openhab/binding/mercedesme/internal/utils/Utils.java b/bundles/org.openhab.binding.mercedesme/src/main/java/org/openhab/binding/mercedesme/internal/utils/Utils.java index 3be8fecdd3a..8d238afa7f5 100644 --- a/bundles/org.openhab.binding.mercedesme/src/main/java/org/openhab/binding/mercedesme/internal/utils/Utils.java +++ b/bundles/org.openhab.binding.mercedesme/src/main/java/org/openhab/binding/mercedesme/internal/utils/Utils.java @@ -107,8 +107,7 @@ public class Utils { * @return openHAB DateTimeType according to configured TimeZone */ public static DateTimeType getDateTimeType(long ms) { - Instant timestamp = Instant.ofEpochMilli(ms); - return new DateTimeType(timestamp.atZone(timeZoneProvider.getTimeZone())); + return new DateTimeType(Instant.ofEpochMilli(ms)); } /**