List of usage examples for org.joda.time.format DateTimeFormatterBuilder DateTimeFormatterBuilder
public DateTimeFormatterBuilder()
From source file:org.whole.lang.xsd.parsers.SchemaDataTypeParsers.java
License:Open Source License
private static DateTimePrinter monthDayPrinter() { if (mdprt == null) { mdprt = new DateTimeFormatterBuilder().appendLiteral("--").appendMonthOfYear(2).appendLiteral('-') .appendDayOfMonth(2).append(timeZoneFormatter()).toPrinter(); }//from w w w. j av a 2s . c o m return mdprt; }
From source file:org.whole.lang.xsd.parsers.SchemaDataTypeParsers.java
License:Open Source License
private static DateTimeParser monthParser() { if (mp == null) { mp = new DateTimeFormatterBuilder().appendLiteral("--").appendMonthOfYear(2) .appendOptional(new TimeZoneValidatingParser(timeZoneFormatter().getParser())).toParser(); }/*from w ww . j a v a 2 s. co m*/ return mp; }
From source file:org.whole.lang.xsd.parsers.SchemaDataTypeParsers.java
License:Open Source License
private static DateTimePrinter monthPrinter() { if (mprt == null) { mprt = new DateTimeFormatterBuilder().appendLiteral("--").appendMonthOfYear(2) .append(timeZoneFormatter()).toPrinter(); }//from w w w . ja v a 2 s .c o m return mprt; }
From source file:org.whole.lang.xsd.parsers.SchemaDataTypeParsers.java
License:Open Source License
private static DateTimeParser dayParser() { if (dyp == null) { dyp = new DateTimeFormatterBuilder().appendLiteral("---").appendDayOfMonth(2) .appendOptional(new TimeZoneValidatingParser(timeZoneFormatter().getParser())).toParser(); }//from www.j a va 2 s .co m return dyp; }
From source file:org.whole.lang.xsd.parsers.SchemaDataTypeParsers.java
License:Open Source License
private static DateTimePrinter dayPrinter() { if (dyprt == null) { dyprt = new DateTimeFormatterBuilder().appendLiteral("---").appendDayOfMonth(2) .append(timeZoneFormatter()).toPrinter(); }// ww w . ja va 2 s .c o m return dyprt; }
From source file:se.vgregion.pubsub.content.DateTimeUtils.java
License:Open Source License
/** * Parses common date time formats in feeds * @param value//from w w w. ja v a 2 s. com * @return */ public static DateTime parseDateTime(String value) { // Tue, 18 Jan 2011 07:42:14 +0000 DateTimeFormatter parser; if (Character.isDigit(value.charAt(0))) { // assume ISO parser = ISODateTimeFormat.dateTimeParser(); } else { // assume RSS datetime parser = new DateTimeFormatterBuilder().appendDayOfWeekShortText().appendLiteral(", ") .appendDayOfMonth(1).appendLiteral(" ").appendMonthOfYearShortText().appendLiteral(" ") .appendYear(4, 4).appendLiteral(" ").appendHourOfDay(2).appendLiteral(":").appendMinuteOfHour(2) .appendLiteral(":").appendSecondOfMinute(2).appendLiteral(" +0000").toFormatter(); } parser = parser.withZone(DateTimeZone.UTC).withLocale(Locale.US); return parser.parseDateTime(value); }
From source file:zack.yovel.clear.controller.foreground.DailyFragment.java
License:Apache License
public DateTimeFormatter getDateTimeFormatter() { DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder(); builder.appendDayOfWeekShortText();/* w ww. j a v a 2 s . com*/ return builder.toFormatter(); }
From source file:zack.yovel.clear.controller.foreground.HourlyFragment.java
License:Apache License
private DateTimeFormatter getDateTimeFormatter() { DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder(); builder.appendDayOfWeekShortText().appendLiteral(' ').appendHourOfDay(1).appendLiteral(':') .appendMinuteOfHour(2);// w w w . j a v a 2s . co m return builder.toFormatter(); }