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
This commit is contained in:
Ryan Ernst 2018-11-16 15:46:27 -08:00 committed by GitHub
parent 22933ebcd5
commit 3c03975ce3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -20,7 +20,6 @@ import org.joda.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
public class CronEvalTool extends LoggingAwareCommand {
@ -31,7 +30,7 @@ public class CronEvalTool extends LoggingAwareCommand {
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;