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

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

Introduction

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

Prototype

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

Source Link

Document

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

Usage

From source file:com.liferay.portal.util.FastDateFormatFactoryImpl.java

public Format getDate(int style, Locale locale, TimeZone timeZone) {

    ///////////// Start of modifications /////////////
    locale = PlatformLocaleUtil.get().getAdminLocale(locale);
    /////////////  End of modifications  /////////////

    String key = getKey(style, locale, timeZone);

    Format format = _dateFormats.get(key);

    if (format == null) {
        format = FastDateFormat.getDateInstance(style, timeZone, locale);

        _dateFormats.put(key, format);// w  w  w  . ja  v  a 2 s . co m
    }

    return format;
}