]> git.basschouten.com Git - openhab-addons.git/commitdiff
[remoteopenhab] Fix the pattern to parse DateTime (#13349)
authorlolodomo <lg.hc@free.fr>
Tue, 6 Sep 2022 18:27:31 +0000 (20:27 +0200)
committerGitHub <noreply@github.com>
Tue, 6 Sep 2022 18:27:31 +0000 (20:27 +0200)
Re-use the same pattern as defined in class DateTimeTyoe.

Allows the support of 0 to 9 digits after the seconds.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/handler/RemoteopenhabBridgeHandler.java

index 8729f8f703243e3bf8ee4fcad3ba6368e4417649..a7366e97247ea144bd61eb55c24b2f0df3e8e49f 100644 (file)
@@ -98,7 +98,7 @@ import com.google.gson.Gson;
 public class RemoteopenhabBridgeHandler extends BaseBridgeHandler
         implements RemoteopenhabStreamingDataListener, RemoteopenhabItemsDataListener {
 
-    private static final String DATE_FORMAT_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
+    private static final String DATE_FORMAT_PATTERN = "yyyy-MM-dd'T'HH:mm[:ss[.SSSSSSSSS][.SSSSSSSS][.SSSSSSS][.SSSSSS][.SSSSS][.SSSS][.SSS][.SS][.S]]Z";
     private static final DateTimeFormatter FORMATTER_DATE = DateTimeFormatter.ofPattern(DATE_FORMAT_PATTERN);
 
     private static final int MAX_STATE_SIZE_FOR_LOGGING = 50;