Java Code Examples for org.apache.commons.lang.time.FastDateFormat#format()

The following examples show how to use org.apache.commons.lang.time.FastDateFormat#format() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Parser.java    From j-road with Apache License 2.0 4 votes vote down vote up
private static String getFormatString(Date date, FastDateFormat format){
  String formatString = format.format(date);
  return extractDateTime(formatString);
}
 
Example 2
Source File: DateUtils.java    From training with MIT License 2 votes vote down vote up
/**
 * Format given date using given format pattern.
 * 
 * @param date the date to format
 * @param pattern the pattern to use ({@link SimpleDateFormat})
 * @return the resulting string
 */
public static String format(Date date, String pattern) {
	FastDateFormat formatter = FastDateFormat.getInstance(pattern);
	return formatter.format(date);
}
 
Example 3
Source File: DateUtils.java    From training with MIT License 2 votes vote down vote up
/**
 * Format given date using given format pattern and locale
 * 
 * @param date the date to format
 * @param pattern the pattern to use ({@link SimpleDateFormat})
 * @return the resulting string
 */
public static String format(Date date, String pattern, Locale locale) {
	FastDateFormat formatter = FastDateFormat.getInstance(pattern, locale);
	return formatter.format(date);
}