diff --git a/bundles/org.openhab.persistence.jpa/src/main/java/org/openhab/persistence/jpa/internal/JpaHistoricItem.java b/bundles/org.openhab.persistence.jpa/src/main/java/org/openhab/persistence/jpa/internal/JpaHistoricItem.java index 159ead428c9..61e1481cad6 100644 --- a/bundles/org.openhab.persistence.jpa/src/main/java/org/openhab/persistence/jpa/internal/JpaHistoricItem.java +++ b/bundles/org.openhab.persistence.jpa/src/main/java/org/openhab/persistence/jpa/internal/JpaHistoricItem.java @@ -142,8 +142,7 @@ public class JpaHistoricItem implements HistoricItem { } else if (item instanceof RollershutterItem) { state = PercentType.valueOf(pItem.getValue()); } else if (item instanceof DateTimeItem) { - state = new DateTimeType(ZonedDateTime.ofInstant(Instant.ofEpochMilli(Long.parseLong(pItem.getValue())), - ZoneId.systemDefault())); + state = new DateTimeType(Instant.ofEpochMilli(Long.parseLong(pItem.getValue()))); } else if (item instanceof LocationItem) { PointType pType = null; String[] comps = pItem.getValue().split(";"); diff --git a/bundles/org.openhab.persistence.jpa/src/main/java/org/openhab/persistence/jpa/internal/StateHelper.java b/bundles/org.openhab.persistence.jpa/src/main/java/org/openhab/persistence/jpa/internal/StateHelper.java index 96108f717fa..ca24a0427a4 100644 --- a/bundles/org.openhab.persistence.jpa/src/main/java/org/openhab/persistence/jpa/internal/StateHelper.java +++ b/bundles/org.openhab.persistence.jpa/src/main/java/org/openhab/persistence/jpa/internal/StateHelper.java @@ -37,7 +37,7 @@ public class StateHelper { */ public static String toString(State state) { if (state instanceof DateTimeType type) { - return String.valueOf(type.getZonedDateTime().toInstant().toEpochMilli()); + return String.valueOf(type.getInstant().toEpochMilli()); } if (state instanceof DecimalType type) { return String.valueOf(type.doubleValue());