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

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

Introduction

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

Prototype

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

Source Link

Document

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

Usage

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

public Format getTime(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 = _timeFormats.get(key);

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

        _timeFormats.put(key, format);/*from   ww w.  j  a  va2 s .c  om*/
    }

    return format;
}