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

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

Introduction

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

Prototype

public static FastDateFormat getDateTimeInstance(final int dateStyle, final int timeStyle,
        final TimeZone timeZone, final Locale locale) 

Source Link

Document

Gets a date/time formatter instance using the specified style, time zone and locale.

Usage

From source file:architecture.ee.component.core.lifecycle.ConfigServiceImpl.java

public String formatDateTime(Date date) {
    if (dateTimeFormat == null) {
        if (properties != null) {
            dateTimeFormat = FastDateFormat.getDateTimeInstance(2, 2, getTimeZone(), getLocale());
        } else {/*  w ww.j  a  v  a2 s  .com*/
            FastDateFormat instance = FastDateFormat.getDateTimeInstance(2, 2, getTimeZone(), getLocale());
            return instance.format(date);
        }
    }
    return dateTimeFormat.format(date);
}

From source file:org.apache.openmeetings.service.mail.template.subject.AppointmentTemplate.java

protected String format(Date d, int fmt) {
    return FastDateFormat.getDateTimeInstance(fmt, fmt, tz, locale).format(d);
}