[erlang-questions] Date parsing (RFC 7231)

Roberto Ostinelli roberto@REDACTED
Fri Apr 3 18:09:57 CEST 2015


I was playing with:
io_lib:fread("~3s, ~2d ~3s ~4d ~2d:~2d:~2d GMT", Date7231)

Looking at cowlib you're binary parsing instead. Thank you Loïc.

Best,
r.


On Fri, Apr 3, 2015 at 9:07 AM, Loïc Hoguin <essen@REDACTED> wrote:

> cow_date:parse_date(Bin).
>
> Returns {{Y,Mo,D},{H,Mi,S}}.
>
>
> On 04/03/2015 06:59 PM, Roberto Ostinelli wrote:
>
>> All,
>> The Date field of HTTP headers uses date format as defined in RFC 7231,
>> for example:
>>
>> Date: Tue, 15 Nov 1994 08:12:31 GMT
>>
>> What is the fastest way to parse this header and convert it to an epoch
>> time?
>>
>> Best,
>> r.
>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
> --
> Loïc Hoguin
> http://ninenines.eu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150403/74453cdc/attachment.htm>


More information about the erlang-questions mailing list