Watcher: Use joda method to get local TZ ()

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 
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

@ -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;