Home » HttpComponents-Core-4.0.1 » org.apache.http.util » [javadoc | source]
org.apache.http.util
public class: DateUtils [javadoc | source]
java.lang.Object
   org.apache.http.util.DateUtils
A utility class for parsing and formatting HTTP dates as used in cookies and other headers. This class handles dates as defined by RFC 2616 section 3.3.1 as well as some other common non-standard formats.
Field Summary
public static final  String PATTERN_RFC1123    Date format pattern used to parse HTTP date headers in RFC 1123 format. 
public static final  String PATTERN_RFC1036    Date format pattern used to parse HTTP date headers in RFC 1036 format. 
public static final  String PATTERN_ASCTIME    Date format pattern used to parse HTTP date headers in ANSI C asctime() format. 
public static final  TimeZone GMT     
Method from org.apache.http.util.DateUtils Summary:
formatDate,   formatDate,   parseDate,   parseDate,   parseDate
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.http.util.DateUtils Detail:
 public static String formatDate(Date date) 
    Formats the given date according to the RFC 1123 pattern.
 public static String formatDate(Date date,
    String pattern) 
    Formats the given date according to the specified pattern. The pattern must conform to that used by the simple date format class.
 public static Date parseDate(String dateValue) throws DateParseException 
    Parses a date value. The formats used for parsing the date value are retrieved from the default http params.
 public static Date parseDate(String dateValue,
    String[] dateFormats) throws DateParseException 
    Parses the date value using the given date formats.
 public static Date parseDate(String dateValue,
    String[] dateFormats,
    Date startDate) throws DateParseException 
    Parses the date value using the given date formats.