Example usage for org.apache.commons.lang3.time FastDateFormat getTimeInstance

List of usage examples for org.apache.commons.lang3.time FastDateFormat getTimeInstance

Introduction

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

Prototype

public static FastDateFormat getTimeInstance(final int style) 

Source Link

Document

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

Usage

From source file:storybook.toolkit.swing.SwingUtil.java

public static JLabel createTimestampLabel() {
    Date date = new Date();
    String dateStr = FastDateFormat.getDateInstance(FastDateFormat.MEDIUM).format(date);
    String timeStr = FastDateFormat.getTimeInstance(FastDateFormat.MEDIUM).format(date);
    return new JLabel(dateStr + " - " + timeStr);
}