From 1af326dbb7b272208f5b2b5b47a6061688503bdc Mon Sep 17 00:00:00 2001 From: Jacob Laursen Date: Mon, 18 Nov 2024 20:32:11 +0100 Subject: [PATCH] Simplify DateTimeType handling for PLCLogo Signed-off-by: Jacob Laursen --- .../binding/plclogo/internal/handler/PLCDateTimeHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCDateTimeHandler.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCDateTimeHandler.java index fddbf4d640b..74e626750d4 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCDateTimeHandler.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCDateTimeHandler.java @@ -14,6 +14,7 @@ package org.openhab.binding.plclogo.internal.handler; import static org.openhab.binding.plclogo.internal.PLCLogoBindingConstants.*; +import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.List; import java.util.Map; @@ -93,7 +94,7 @@ public class PLCDateTimeHandler extends PLCCommonHandler { byte[] buffer = new byte[2]; String type = channel.getAcceptedItemType(); if (DATE_TIME_ITEM.equalsIgnoreCase(type)) { - ZonedDateTime datetime = dateTimeCommand.getZonedDateTime(); + ZonedDateTime datetime = dateTimeCommand.getZonedDateTime(ZoneId.systemDefault()); if ("Time".equalsIgnoreCase(channelUID.getId())) { buffer[0] = S7.ByteToBCD(datetime.getHour()); buffer[1] = S7.ByteToBCD(datetime.getMinute());