private static DateTimeFormatter yearElement() { if (ye == null) { return new DateTimeFormatterBuilder() .appendFixedSignedDecimal(DateTimeFieldType.year(), 4) // ES change, was .appendYear(4, 9) .toFormatter(); } return ye; }
private static DateTimeFormatter weekyearElement() { if (we == null) { return new DateTimeFormatterBuilder() .appendFixedSignedDecimal(DateTimeFieldType.weekyear(), 4) // ES change, was .appendWeekyear(4, 9) .toFormatter(); } return we; }
private static DateTimeFormatter hourElement() { if (hde == null) { return new DateTimeFormatterBuilder() .appendFixedSignedDecimal(DateTimeFieldType.hourOfDay(), 2) // ES change, was .appendHourOfDay(2) .toFormatter(); } return hde; }
private static DateTimeFormatter dayOfMonthElement() { if (dme == null) { return new DateTimeFormatterBuilder() .appendLiteral('-') .appendFixedSignedDecimal(DateTimeFieldType.dayOfMonth(), 2) // ES change, was .appendDayOfMonth(2) .toFormatter(); } return dme; }
private static DateTimeFormatter secondElement() { if (sme == null) { return new DateTimeFormatterBuilder() .appendLiteral(':') .appendFixedSignedDecimal(DateTimeFieldType.secondOfMinute(), 2) // ES change, was .appendSecondOfMinute(2) .toFormatter(); } return sme; }
private static DateTimeFormatter monthElement() { if (mye == null) { return new DateTimeFormatterBuilder() .appendLiteral('-') .appendFixedSignedDecimal(DateTimeFieldType.monthOfYear(), 2) // ES change, was .appendMonthOfYear(2) .toFormatter(); } return mye; }
private static DateTimeFormatter dayOfYearElement() { if (dye == null) { return new DateTimeFormatterBuilder() .appendLiteral('-') .appendFixedSignedDecimal(DateTimeFieldType.dayOfYear(), 3) // ES change, was .appendDayOfYear(3) .toFormatter(); } return dye; }
private static DateTimeFormatter weekElement() { if (wwe == null) { return new DateTimeFormatterBuilder() .appendLiteral("-W") .appendFixedSignedDecimal(DateTimeFieldType.weekOfWeekyear(), 2) // ES change, was .appendWeekOfWeekyear(2) .toFormatter(); } return wwe; }
private static DateTimeFormatter minuteElement() { if (mhe == null) { return new DateTimeFormatterBuilder() .appendLiteral(':') .appendFixedSignedDecimal(DateTimeFieldType.minuteOfHour(), 2) // ES change, was .appendMinuteOfHour(2) .toFormatter(); } return mhe; }
private static DateTimeFormatter basicWeekDate() { if (bwd == null) { return new DateTimeFormatterBuilder() .appendFixedSignedDecimal(DateTimeFieldType.weekyear(), 4) // ES change, was .appendWeekyear(4, 4) .appendLiteral('W') .appendFixedDecimal(DateTimeFieldType.weekOfWeekyear(), 2) .appendFixedDecimal(DateTimeFieldType.dayOfWeek(), 1) .toFormatter(); } return bwd; }
public static DateFormatter getStrictStandardDateFormatter() { // 2014/10/10 DateTimeFormatter shortFormatter = new DateTimeFormatterBuilder() .appendFixedDecimal(DateTimeFieldType.year(), 4) .appendLiteral('/') .appendFixedDecimal(DateTimeFieldType.monthOfYear(), 2) .appendLiteral('/') .appendFixedDecimal(DateTimeFieldType.dayOfMonth(), 2) .toFormatter() .withZoneUTC(); // 2014/10/10 12:12:12 DateTimeFormatter longFormatter = new DateTimeFormatterBuilder() .appendFixedDecimal(DateTimeFieldType.year(), 4) .appendLiteral('/') .appendFixedDecimal(DateTimeFieldType.monthOfYear(), 2) .appendLiteral('/') .appendFixedDecimal(DateTimeFieldType.dayOfMonth(), 2) .appendLiteral(' ') .appendFixedSignedDecimal(DateTimeFieldType.hourOfDay(), 2) .appendLiteral(':') .appendFixedSignedDecimal(DateTimeFieldType.minuteOfHour(), 2) .appendLiteral(':') .appendFixedSignedDecimal(DateTimeFieldType.secondOfMinute(), 2) .toFormatter() .withZoneUTC(); DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder().append(longFormatter.withZone(DateTimeZone.UTC).getPrinter(), new DateTimeParser[]{longFormatter.getParser(), shortFormatter.getParser(), new EpochTimeParser(true)}); DateTimeFormatter formatter = builder.toFormatter().withLocale(Locale.ROOT).withZone(DateTimeZone.UTC); return new JodaDateFormatter("yyyy/MM/dd HH:mm:ss||yyyy/MM/dd||epoch_millis", formatter, formatter); }
private static DateTimeFormatter weekyearElement() { if (we == null) { return new DateTimeFormatterBuilder() .appendFixedSignedDecimal(DateTimeFieldType.weekyear(), 4) // ES change, was .appendWeekyear(4, 9) .toFormatter(); } return we; }
private static DateTimeFormatter weekyearElement() { if (we == null) { return new DateTimeFormatterBuilder() .appendFixedSignedDecimal(DateTimeFieldType.weekyear(), 4) // ES change, was .appendWeekyear(4, 9) .toFormatter(); } return we; }
private static DateTimeFormatter hourElement() { if (hde == null) { return new DateTimeFormatterBuilder() .appendFixedSignedDecimal(DateTimeFieldType.hourOfDay(), 2) // ES change, was .appendHourOfDay(2) .toFormatter(); } return hde; }
private static DateTimeFormatter secondElement() { if (sme == null) { return new DateTimeFormatterBuilder() .appendLiteral(':') .appendFixedSignedDecimal(DateTimeFieldType.secondOfMinute(), 2) // ES change, was .appendSecondOfMinute(2) .toFormatter(); } return sme; }
private static DateTimeFormatter secondElement() { if (sme == null) { return new DateTimeFormatterBuilder() .appendLiteral(':') .appendFixedSignedDecimal(DateTimeFieldType.secondOfMinute(), 2) // ES change, was .appendSecondOfMinute(2) .toFormatter(); } return sme; }
private static DateTimeFormatter secondElement() { if (sme == null) { return new DateTimeFormatterBuilder() .appendLiteral(':') .appendFixedSignedDecimal(DateTimeFieldType.secondOfMinute(), 2) // ES change, was .appendSecondOfMinute(2) .toFormatter(); } return sme; }
private static DateTimeFormatter dayOfYearElement() { if (dye == null) { return new DateTimeFormatterBuilder() .appendLiteral('-') .appendFixedSignedDecimal(DateTimeFieldType.dayOfYear(), 3) // ES change, was .appendDayOfYear(3) .toFormatter(); } return dye; }
private static DateTimeFormatter weekElement() { if (wwe == null) { return new DateTimeFormatterBuilder() .appendLiteral("-W") .appendFixedSignedDecimal(DateTimeFieldType.weekOfWeekyear(), 2) // ES change, was .appendWeekOfWeekyear(2) .toFormatter(); } return wwe; }
private static DateTimeFormatter dayOfYearElement() { if (dye == null) { return new DateTimeFormatterBuilder() .appendLiteral('-') .appendFixedSignedDecimal(DateTimeFieldType.dayOfYear(), 3) // ES change, was .appendDayOfYear(3) .toFormatter(); } return dye; }