- public static final String DATETIME_PATTERN = TIME_PATTERN + " " + DATE_PATTERN;
-
- private static final TimeZone CTZ = TimeZone.getTimeZone("CET");
- private static final TimeZone LTZ = TimeZone.getDefault();
-
- private static final DateFormat DATE_FORMAT = new SimpleDateFormat(DATE_PATTERN);
- private static final DateFormat CET_TIME_FORMAT = new SimpleDateFormat(TIME_PATTERN);
- private static final DateFormat CET_DATETIME_FORMAT = new SimpleDateFormat(DATETIME_PATTERN);
- private static final DateFormat LOCAL_TIME_FORMAT = new SimpleDateFormat(TIME_PATTERN);
- private static final DateFormat LOCAL_DATETIME_FORMAT = new SimpleDateFormat(DATETIME_PATTERN);
-
- static {
- CET_TIME_FORMAT.setTimeZone(CTZ);
- CET_DATETIME_FORMAT.setTimeZone(CTZ);
- LOCAL_TIME_FORMAT.setTimeZone(LTZ);
- LOCAL_DATETIME_FORMAT.setTimeZone(LTZ);
+ public static final String DATETIME_PATTERN = String.format("%s %s", TIME_PATTERN , DATE_PATTERN);
+
+ private static final TimeZone SNOOKER_TIMEZONE = TimeZone.getTimeZone("CET");
+ private static final TimeZone LOCAL_TIMEZONE = TimeZone.getDefault();
+
+ private final DateFormat dateFormat;
+ private final DateFormat snookerTimeFormat;
+ private final DateFormat snookerDateTimeFormat;
+ private final DateFormat localTimeFormat;
+ private final DateFormat localDateTimeFormat;
+
+ private SnookerDateUtils() {
+ dateFormat = new SimpleDateFormat(DATE_PATTERN);
+
+ snookerTimeFormat = new SimpleDateFormat(TIME_PATTERN);
+ snookerTimeFormat.setTimeZone(SNOOKER_TIMEZONE);
+
+ snookerDateTimeFormat = new SimpleDateFormat(DATETIME_PATTERN);
+ snookerDateTimeFormat.setTimeZone(SNOOKER_TIMEZONE);
+
+ localTimeFormat = new SimpleDateFormat(TIME_PATTERN);
+ localTimeFormat.setTimeZone(LOCAL_TIMEZONE);
+
+ localDateTimeFormat = new SimpleDateFormat(DATETIME_PATTERN);
+ localDateTimeFormat.setTimeZone(LOCAL_TIMEZONE);