hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Becke <be...@u.washington.edu>
Subject Re: DateParser pluggability
Date Fri, 02 Jan 2004 22:07:33 GMT
Hello,

Date parser formats can be configured in the post 2.0 HttpClient code.  
This code, in CVS HEAD, is still pre-alpha but everything should still 
be working.  You can add a format using something like the following:

         HttpParams params = DefaultHttpParams.getDefaultParams();
         HashSet patterns = new HashSet((Collection) 
params.getParameter(DateParser.KEY_DATE_PATTERNS));
         patterns.add("SOME_PATTERN");
         params.setParameter(DateParser.KEY_DATE_PATTERNS, patterns);

Mike

On Dec 31, 2003, at 10:57 AM, protean wrote:

> I have had to supply an extra format String as follows:
>
>    /** The patterns used for parsing dates */
>     private static final String[] DATE_PATTERNS = {
>         PATTERN_RFC1123,
>         PATTERN_RFC1036,
>         PATTERN_ASCTIME,
>         "EEE, dd-MMM-yyyy HH:mm:ss z",
>         "EEE, dd-MMM-yyyy HH-mm-ss z",
>         "EEE, dd MMM yy HH:mm:ss z",
>         "EEE dd-MMM-yyyy HH:mm:ss z",
>         "EEE dd MMM yyyy HH:mm:ss z",
>         "EEE dd-MMM-yyyy HH-mm-ss z",
>         "EEE dd-MMM-yy HH:mm:ss z",
>         "EEE dd MMM yy HH:mm:ss z",
>         "EEE,dd-MMM-yy HH:mm:ss z",
>         "EEE,dd-MMM-yyyy HH:mm:ss z",
>         "EEE, dd-MM-yyyy HH:mm:ss z",
>         // Extra for non-compliant site
>         "dd-MMM-yyyy HH:mm:ss zzz"
>     };
>
> to the DateParser class and produce my own build, as the DateParser 
> does not
> seem to provide pluggability for non-compliant sites. Can anyone tell 
> me when
> this situation may change so I no longer have to produce a one-man 
> code fork?
>
> C Johnson
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: 
> commons-httpclient-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Mime
View raw message