Skip to content

Commit 3c03975

Browse files
authored
Watcher: Use joda method to get local TZ (#35608)
This commit switches from using java util's default timezone method to using joda. The former can cause problems when the string representation of the timezone is unknown to joda. closes #35518
1 parent 22933eb commit 3c03975

File tree

1 file changed

+1
-2
lines changed
  • x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/tool

1 file changed

+1
-2
lines changed

x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/tool/CronEvalTool.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import java.util.Arrays;
2121
import java.util.List;
2222
import java.util.Locale;
23-
import java.util.TimeZone;
2423

2524
public class CronEvalTool extends LoggingAwareCommand {
2625

@@ -31,7 +30,7 @@ public static void main(String[] args) throws Exception {
3130
private static final DateTimeFormatter UTC_FORMATTER = DateTimeFormat.forPattern("EEE, d MMM yyyy HH:mm:ss")
3231
.withZone(DateTimeZone.UTC).withLocale(Locale.ROOT);
3332
private static final DateTimeFormatter LOCAL_FORMATTER = DateTimeFormat.forPattern("EEE, d MMM yyyy HH:mm:ss Z")
34-
.withZone(DateTimeZone.forTimeZone(TimeZone.getDefault()));
33+
.withZone(DateTimeZone.forTimeZone(null));
3534

3635
private final OptionSpec<Integer> countOption;
3736
private final OptionSpec<String> arguments;

0 commit comments

Comments
 (0)