Example usage for org.apache.commons.lang3.time FastDateFormat getDateInstance

List of usage examples for org.apache.commons.lang3.time FastDateFormat getDateInstance

Introduction

In this page you can find the example usage for org.apache.commons.lang3.time FastDateFormat getDateInstance.

Prototype

public static FastDateFormat getDateInstance(final int style, final TimeZone timeZone, final Locale locale) 

Source Link

Document

Gets a date formatter instance using the specified style, time zone and locale.

Usage

From source file:architecture.ee.component.core.lifecycle.ConfigServiceImpl.java

public String formatDate(Date date) {
    if (dateFormat == null) {
        if (properties != null) {
            dateFormat = FastDateFormat.getDateInstance(2, getTimeZone(), getLocale());
        } else {/*from   w w w .j a v  a2 s.c  o  m*/
            FastDateFormat instance = FastDateFormat.getDateInstance(2, getTimeZone(), getLocale());
            return instance.format(date);
        }
    }
    return dateFormat.format(date);
}