Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49859 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56288 invoked from network); 4 Oct 2010 02:14:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Oct 2010 02:14:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.54 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-ww0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:46428] helo=mail-ww0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 58/99-22289-E6839AC4 for ; Sun, 03 Oct 2010 22:14:06 -0400 Received: by wwb13 with SMTP id 13so150379wwb.11 for ; Sun, 03 Oct 2010 19:14:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=1jvVxdKwY756EnE9clug/X4KQiDivCi8t+0pX9xgTJo=; b=WRONHXbI/exBMJdaGKNg1ksd9c0hIB0ZeEc6E3MWOQBEJ0B1aCe8oKgZYC+sdNEJPR 1ALNOQjmGkZeKeubPJaybp3FDJat+Lz7vWess0vvevqWfRa0kXbyibtqyQGiNIVFRji3 tt4MGQN5cjSht0q0kwESjJQL5+EfRUouINGqo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=GMXV8OYmkGVGwxTAS3pOe1Us691X+ujK701GsX/NuaORbhGtKXwoV6atDMsgvSe1tu GORCNzJ8JJ7va2089+hZC3fR0yQwfXY0Mh+TuEL65SyR3N+Zz6ov2p4nJOHJS7YXQiuc 57H4MF5cfbI46nmlcXXad0k8i66mwFI9FU1xg= MIME-Version: 1.0 Received: by 10.227.157.198 with SMTP id c6mr7134782wbx.144.1286158442691; Sun, 03 Oct 2010 19:14:02 -0700 (PDT) Received: by 10.227.130.164 with HTTP; Sun, 3 Oct 2010 19:14:02 -0700 (PDT) In-Reply-To: <4CA91151.2010104@sugarcrm.com> References: <4CA6885F.3040709@sugarcrm.com> <4CA91151.2010104@sugarcrm.com> Date: Mon, 4 Oct 2010 04:14:02 +0200 Message-ID: To: Stas Malyshev Cc: Derick Rethans , PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] rfc2616 datetime format? From: pierre.php@gmail.com (Pierre Joye) hi Stas, On Mon, Oct 4, 2010 at 1:27 AM, Stas Malyshev wrote: > Hi! > >> 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. Cheers, -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org