From 44fd6a264e630ccbf0ce6524f2a7d17d4674075c Mon Sep 17 00:00:00 2001 From: Ben Nadler Date: Sat, 15 Apr 2023 09:33:33 -0700 Subject: [PATCH] Add to regex to account for zero second behavior --- .../oryanmoshe/kafka/connect/util/TimestampConverter.java | 8 +++++--- .../kafka/connect/util/TimestampConverterTests.java | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/oryanmoshe/kafka/connect/util/TimestampConverter.java b/src/main/java/oryanmoshe/kafka/connect/util/TimestampConverter.java index 8c87252..d66a1c8 100644 --- a/src/main/java/oryanmoshe/kafka/connect/util/TimestampConverter.java +++ b/src/main/java/oryanmoshe/kafka/connect/util/TimestampConverter.java @@ -30,7 +30,7 @@ public class TimestampConverter implements CustomConverter SUPPORTED_DATA_TYPES = List.of("date", "time", "datetime", "timestamp", "datetime2"); - private static final String DATETIME_REGEX = "(?(?(?:(?\\d{4})-(?\\d{1,2})-(?\\d{1,2}))|(?:(?\\d{1,2})\\/(?\\d{1,2})\\/(?\\d{4}))|(?:(?\\d{1,2})-(?\\w{3})-(?\\d{4})))?(?:\\s?T?(?