Parsing HTTP dates

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Parsing HTTP dates

Sean P. DeNigris
Administrator
In HTTP/1.1, valid dates come in 3 forms (per http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1) :
  Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
  Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
  Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format

All 3 fail in Pharo 1.4 with #asDateAndTime.

It'd be easy enough to write a parser for them, but it seems so common... I searched google and the seaside lists but found no mention of "date parse HTTP".
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Parsing HTTP dates

Philippe Marschall
On Thu, May 10, 2012 at 3:56 PM, Sean P. DeNigris <[hidden email]> wrote:

> In HTTP/1.1, valid dates come in 3 forms (per
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1) :
>  Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
>  Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
>  Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
>
> All 3 fail in Pharo 1.4 with #asDateAndTime.
>
> It'd be easy enough to write a parser for them, but it seems so common... I
> searched google and the seaside lists but found no mention of "date parse
> HTTP".

Feel free to submit a bug … and code … and tests ;-)

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Parsing HTTP dates

Sean P. DeNigris
Administrator
Philippe Marschall wrote
Feel free to submit a bug … and code … and tests ;-)
If anyone needs such functionality, it is part of Zinc (see ZincUtils). I fixed the code and tests to handle all three cases.

Sean
Cheers,
Sean