Example usage for org.joda.time.format DateTimeFormatter withDefaultYear

List of usage examples for org.joda.time.format DateTimeFormatter withDefaultYear

Introduction

In this page you can find the example usage for org.joda.time.format DateTimeFormatter withDefaultYear.

Prototype

public DateTimeFormatter withDefaultYear(int defaultYear) 

Source Link

Document

Returns a new formatter that will use the specified default year.

Usage

From source file:com.tuplejump.stargate.FormatDateTimeFormatter.java

License:Apache License

public FormatDateTimeFormatter(String format, DateTimeFormatter parser, DateTimeFormatter printer,
        Locale locale) {/* ww  w.j av  a  2 s  .c  om*/
    this.format = format;
    this.locale = locale;
    this.printer = locale == null ? printer.withDefaultYear(1970)
            : printer.withLocale(locale).withDefaultYear(1970);
    this.parser = locale == null ? parser.withDefaultYear(1970)
            : parser.withLocale(locale).withDefaultYear(1970);
}