public static String toDateString ( final Date date ) { SimpleDateFormat df = RFC1123_PATTERN_FORMAT . get ( ) ; //we always need to set the time zone //because date format is stupid, and calling parse() can mutate the timezone //see UNDERTOW-458 df . setTimeZone ( GMT_ZONE ) ; return df . format ( date ) ; }
Converts a date to a format suitable for use in a HTTP request