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

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

Introduction

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

Prototype

public String getPattern() 

Source Link

Document

Gets the pattern used by this formatter.

Usage

From source file:edu.ku.brc.specify.tests.PreferenceTest.java

/**
 * Tests the Date formating/*www  . j a va  2  s .com*/
 */
public void testSimpleDateFormat() {
    FastDateFormat fastDateFormat = FastDateFormat.getDateInstance(FastDateFormat.SHORT);
    SimpleDateFormat df = new SimpleDateFormat(fastDateFormat.getPattern());
    log.info(df.toPattern());
    log.info(df.format(new Date()));

    fastDateFormat = FastDateFormat.getDateInstance(FastDateFormat.MEDIUM);
    df = new SimpleDateFormat(fastDateFormat.getPattern());
    log.info(df.toPattern());
    log.info(df.format(new Date()));

    fastDateFormat = FastDateFormat.getDateInstance(FastDateFormat.LONG);
    df = new SimpleDateFormat(fastDateFormat.getPattern());
    log.info(df.toPattern());
    log.info(df.format(new Date()));
}