Skip to content

Commit e5ca758

Browse files
[hotfix-#1952][core|doris] Fix ARRAY and LARGEINT type conversion exceptions (#1956)
Co-authored-by: kyotom <[email protected]>
1 parent a3d8d32 commit e5ca758

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

chunjun-core/src/main/java/com/dtstack/chunjun/util/DateUtil.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ public class DateUtil {
4848

4949
private static final String TIME_ZONE = "GMT+8";
5050

51+
private static final boolean isUseLocalTimeZone =
52+
Boolean.parseBoolean(System.getProperty("USE_LOCAL_TIMEZONE"));
53+
5154
private static final String STANDARD_DATETIME_FORMAT = "standardDatetimeFormatter";
5255

5356
private static final String STANDARD_DATETIME_FORMAT_FOR_MILLISECOND =
@@ -97,7 +100,12 @@ public class DateUtil {
97100
public static ThreadLocal<Map<String, SimpleDateFormat>> datetimeFormatter =
98101
ThreadLocal.withInitial(
99102
() -> {
100-
TimeZone timeZone = TimeZone.getTimeZone(TIME_ZONE);
103+
TimeZone timeZone;
104+
if (isUseLocalTimeZone) {
105+
timeZone = TimeZone.getDefault();
106+
} else {
107+
timeZone = TimeZone.getTimeZone(TIME_ZONE);
108+
}
101109

102110
Map<String, SimpleDateFormat> formatterMap = new HashMap<>();
103111
SimpleDateFormat standardDatetimeFormatter =

0 commit comments

Comments
 (0)