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

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

Introduction

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

Prototype

public static synchronized FastDateFormat getDateTimeInstance(int dateStyle, int timeStyle, TimeZone timeZone,
        Locale locale) 

Source Link

Document

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

Usage

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

public Format getDateTime(int dateStyle, int timeStyle, Locale locale, TimeZone timeZone) {

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

    String key = getKey(dateStyle, timeStyle, locale, timeZone);

    Format format = _dateTimeFormats.get(key);

    if (format == null) {
        format = FastDateFormat.getDateTimeInstance(dateStyle, timeStyle, timeZone, locale);

        _dateTimeFormats.put(key, format);
    }/*w  w  w.  j a  v  a2 s . c  o m*/

    return format;
}