[Issue 12886] std.datetime cannot parse HTTP date

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jun 9 19:51:24 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12886

--- Comment #2 from Martin Nowak <code at dawg.eu> ---
I just wanted to do a very simple task, checking that the download cache in the
build script doesn't use outdated files.
https://github.com/D-Programming-Language/installer/blob/90a47d2a73c3150fa7f2bf82ce19e68be8b0f31e/create_dmd_release/common.d#L72
It's already a pain to get the last-modified header from std.net.curl, but
parsing that date is totally out of reach.

There is an simple implementation in vibe.d which oversimplifies the timezone
parsing a little.
https://github.com/rejectedsoftware/vibe.d/blob/8f8c9f96a8a67c3031253a1e8fc030fa59e24d00/source/vibe/inet/message.d#L149

> And I certainly wouldn't want to encourage the use of the RFC 5322 format outside of the specs that require it

I agree to this, how about only adding a free-standing function
parseRFC822DateTime.
This is somewhat similar to isEmail which doesn't really have a good place in
phobos but is practically very useful.

--


More information about the Digitalmars-d-bugs mailing list