[remoteopenhab] Fix the pattern to parse DateTime (#13349)

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>
This commit is contained in:
lolodomo 2022-09-06 20:27:31 +02:00 committed by GitHub
parent fe25216ea6
commit c4625992af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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;