List of usage examples for org.apache.commons.lang.time DateFormatUtils format
public static String format(Date date, String pattern, TimeZone timeZone, Locale locale)
Formats a date/time into a specific pattern in a time zone and locale.
From source file:org.alfresco.repo.webdav.WebDAV.java
/** * Formats the given date for use in the HTTP header * /*from w ww. ja v a 2 s . co m*/ * @param date Date * @return String */ public static String formatHeaderDate(Date date) { // HTTP header date/time format // NOTE: According to RFC2616 dates should always be in English and in // the GMT timezone see http://rfc.net/rfc2616.html#p20 for details return DateFormatUtils.format(date, HEADER_IF_DATE_FORMAT, TimeZone.getTimeZone("GMT"), Locale.ENGLISH); }
From source file:org.alfresco.repo.webdav.WebDAV.java
/** * Formats the given date for use in the HTTP header * //from ww w .j av a 2 s . com * @param ldate long * @return String */ public static String formatHeaderDate(long ldate) { // HTTP header date/time format // NOTE: According to RFC2616 dates should always be in English and in // the GMT timezone see http://rfc.net/rfc2616.html#p20 for details return DateFormatUtils.format(ldate, HEADER_IF_DATE_FORMAT, TimeZone.getTimeZone("GMT"), Locale.ENGLISH); }