Skip to content

Commit

Permalink
Watcher: Use joda method to get local TZ (#35608)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rjernst authored Nov 16, 2018
1 parent 22933eb commit 3c03975
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;

public class CronEvalTool extends LoggingAwareCommand {

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

private final OptionSpec<Integer> countOption;
private final OptionSpec<String> arguments;
Expand Down

0 comments on commit 3c03975

Please sign in to comment.