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

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

Introduction

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

Prototype

int LONG

To view the source code for org.apache.commons.lang.time FastDateFormat LONG.

Click Source Link

Document

LONG locale dependent date or time style.

Usage

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

/**
 * Tests the Date formating//  w ww.j a v  a2  s.  c  o m
 */
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()));
}