Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49860 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90829 invoked from network); 4 Oct 2010 08:42:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Oct 2010 08:42:24 -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:43251] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CB/42-11706-F6399AC4 for ; Mon, 04 Oct 2010 04:42:24 -0400 Received: from localhost (xdebug.org [127.0.0.1]) by xdebug.org (Postfix) with ESMTPS id 9AA8DDE13E; Mon, 4 Oct 2010 09:42:15 +0100 (BST) Date: Mon, 4 Oct 2010 09:42:15 +0100 (BST) X-X-Sender: derick@kossu.derickrethans.nl To: Pierre Joye cc: PHP Internals In-Reply-To: Message-ID: References: <4CA6885F.3040709@sugarcrm.com> <4CA91151.2010104@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 Mon, 4 Oct 2010, Pierre Joye wrote: > On Mon, Oct 4, 2010 at 1:27 AM, Stas Malyshev wrote: > > > >> 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. > > > > I'm not sure what integers have to do with it? The constants define date > > formats that are in common use, RFC2616 is one of the commonest on the web > > and we don't have a constant for it... > > I mean in ext/date and as a reply to Derick, not your request which is > totally valid. A date time object has the timezone information. If the > constants were integers, it would be very straightforward to do some > operations before calling the formatting functions depending on a > given predefined format. It should still be possible to do it by > testing the string contents (strncmp), but that's not very clean. Stop talking about something you don't know anything about, please. Those constants are not *one* format letter, they are many. Maybe you could have tried this: echo DateTime::RFC822, "\n"; Derick