File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
chunjun-core/src/main/java/com/dtstack/chunjun/util Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff 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 =
You can’t perform that action at this time.
0 commit comments