Re: rfc2616 datetime format?
| From: | Pierre Joye | Date: | Sun, 03 Oct 2010 18:50:32 +0000 |
| Subject: | Re: rfc2616 datetime format? | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-49854@lists.php.net to get a copy of this message | ||
hi,
On Sun, Oct 3, 2010 at 8:32 PM, Derick Rethans <derick@php.net> wrote:
> On Fri, 1 Oct 2010, Stas Malyshev wrote:
>
>> Any reason why DateTime doesn't have a constant for RFC2616 (HTTP) date
>> format? RFC1123 and 'r' are _almost_ there but 2616 explicitly states TZ must
>> be "GMT" and 1123 format produces +0000 instead.
>
> The reason is that in order to format a DateTime object as GMT, it needs
> to be converted to GMT... and you can't simply do that with just a
> constant consisting of a string of format characters.
It looks like a sub optimal choice to have used string constants
instead of integer. However it could be still possible to define new
constants as numeric. It is then possible to do whatever needs to be
done as post or pre ops for the respective constants.
Cheers,
--
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org