List of usage examples for org.apache.commons.lang.time FastDateFormat getPattern
public String getPattern()
Gets the pattern used by this formatter.
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())); }