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 FastDateFormat getDateInstance(int style, TimeZone timeZone) 

Source Link

Document

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

Usage

From source file:info.magnolia.jcr.util.PropertyUtil.java

public static String getDateFormat() {
    try {//from  ww w  .  j av a  2 s .c o m
        return FastDateFormat.getDateInstance(FastDateFormat.SHORT, MgnlContext.getLocale()).getPattern();
    } catch (IllegalStateException e) {
        // this happens if the context is not (yet) set
        return DateUtil.YYYY_MM_DD;
    }
}