Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49853 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21002 invoked from network); 3 Oct 2010 18:32:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Oct 2010 18:32:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:39959] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/A5-22289-83CC8AC4 for ; Sun, 03 Oct 2010 14:32:25 -0400 Received: from localhost (xdebug.org [127.0.0.1]) by xdebug.org (Postfix) with ESMTPS id C3FC3DE13E; Sun, 3 Oct 2010 19:32:21 +0100 (BST) Date: Sun, 3 Oct 2010 19:32:21 +0100 (BST) X-X-Sender: derick@kossu.derickrethans.nl To: Stas Malyshev cc: PHP Internals In-Reply-To: <4CA6885F.3040709@sugarcrm.com> Message-ID: References: <4CA6885F.3040709@sugarcrm.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] rfc2616 datetime format? From: derick@php.net (Derick Rethans) 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. cheers, Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug