Re: [Pharo-project] Parsing HTTP dates

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

Re: [Pharo-project] Parsing HTTP dates

Sven Van Caekenberghe
Sean,

On 10 May 2012, at 16:39, Sean P. DeNigris wrote:

> Excerpt from http://forum.world.st/Parsing-HTTP-dates-td4623583.html :
>
>    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.
>
> I posted this to the Seaside list because it seems like there *must* be some
> code out there... This would be a nice utility for Zinc…

You are underestimating me again ;-)

This has been in Zn since a very long time:

ZnUtils>>parseHttpDate: string
        "self parseHttpDate: 'Tue, 13 Sep 2011 08:04:49 GMT'."
        "self parseHttpDate: 'Tue, 13-Sep-2011 08:04:51 GMT'."
        "self parseHttpDate: 'Tue Jan 01 00:00:01 2036 GMT'."

That should cover the spec, no ?

Regards,

Sven

--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill

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

Re: [Pharo-project] Parsing HTTP dates

mmimica
GRPrinter httpDate print: DateAndTime now 'Thu, 10 May 2012 15:11:09 GMT'

On 10 May 2012 17:00, Sven Van Caekenberghe <[hidden email]> wrote:
Sean,

On 10 May 2012, at 16:39, Sean P. DeNigris wrote:

> Excerpt from http://forum.world.st/Parsing-HTTP-dates-td4623583.html :
>
>    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.
>
> I posted this to the Seaside list because it seems like there *must* be some
> code out there... This would be a nice utility for Zinc…

You are underestimating me again ;-)

This has been in Zn since a very long time:

ZnUtils>>parseHttpDate: string
       "self parseHttpDate: 'Tue, 13 Sep 2011 08:04:49 GMT'."
       "self parseHttpDate: 'Tue, 13-Sep-2011 08:04:51 GMT'."
       "self parseHttpDate: 'Tue Jan 01 00:00:01 2036 GMT'."

That should cover the spec, no ?

Regards,

Sven

--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



--
Milan Mimica
http://sparklet.sf.net

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

Re: [Pharo-project] Parsing HTTP dates

mmimica
ah, I see, you want parsing

On 10 May 2012 17:11, Milan Mimica <[hidden email]> wrote:
GRPrinter httpDate print: DateAndTime now 'Thu, 10 May 2012 15:11:09 GMT'


On 10 May 2012 17:00, Sven Van Caekenberghe <[hidden email]> wrote:
Sean,

On 10 May 2012, at 16:39, Sean P. DeNigris wrote:

> Excerpt from http://forum.world.st/Parsing-HTTP-dates-td4623583.html :
>
>    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.
>
> I posted this to the Seaside list because it seems like there *must* be some
> code out there... This would be a nice utility for Zinc…

You are underestimating me again ;-)

This has been in Zn since a very long time:

ZnUtils>>parseHttpDate: string
       "self parseHttpDate: 'Tue, 13 Sep 2011 08:04:49 GMT'."
       "self parseHttpDate: 'Tue, 13-Sep-2011 08:04:51 GMT'."
       "self parseHttpDate: 'Tue Jan 01 00:00:01 2036 GMT'."

That should cover the spec, no ?

Regards,

Sven

--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



--
Milan Mimica
http://sparklet.sf.net



--
Milan Mimica
http://sparklet.sf.net

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside