Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62729 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51342 invoked from network); 3 Sep 2012 12:01:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Sep 2012 12:01:34 -0000 Authentication-Results: pb1.pair.com header.from=wfitch@meetme.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=wfitch@meetme.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain meetme.com designates 74.125.149.207 as permitted sender) X-PHP-List-Original-Sender: wfitch@meetme.com X-Host-Fingerprint: 74.125.149.207 na3sys009aog112.obsmtp.com Linux 2.5 (sometimes 2.4) (4) Received: from [74.125.149.207] ([74.125.149.207:41784] helo=na3sys009aog112.obsmtp.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 15/F5-20751-D1C94405 for ; Mon, 03 Sep 2012 08:01:34 -0400 Received: from mail-vc0-f170.google.com ([209.85.220.170]) (using TLSv1) by na3sys009aob112.postini.com ([74.125.148.12]) with SMTP ID DSNKUEScGr6inTk8+L4nU5mZO/FVdHhTrJ4t@postini.com; Mon, 03 Sep 2012 05:01:33 PDT Received: by vcbgb30 with SMTP id gb30so5886579vcb.29 for ; Mon, 03 Sep 2012 05:01:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=ArQtbKXZcZ0Vo+eBpBnV7qjbkTiCndRUJ1Z5nmmTGlU=; b=c8NgkrncFvm18LcX2GVTrfBppuRl7KEojjVVi0Is/t0pMlZDm7d8M1cF1RM2tlY7n9 73jyot45fXyFXQ17IvIDYyUXtB2yiRgB8zfXFGieYSmEUwc4UyiGcKz/6P1hitW8FNKq I6OKQQrfOUDI3OB6KqSGk4s59e50fVlUQLUa8GOxRRmn6kZMlnkpEgevpmLKlbHWh2xu VB2FfnJt+X370ga0MzQ1CAYmv0VDuCVckv6zKkGgWjq2s4UI4RdB6GFMUC0rhpl7jTZ0 W5mhcTFHMCUynBYfcy3tnIJlSRHpau0nVC17DUdr/tX477Hwpo8nfWuvm2u23ovaNZRs lyYA== MIME-Version: 1.0 Received: by 10.220.220.203 with SMTP id hz11mr12124632vcb.50.1346673690020; Mon, 03 Sep 2012 05:01:30 -0700 (PDT) Received: by 10.58.132.161 with HTTP; Mon, 3 Sep 2012 05:01:29 -0700 (PDT) X-Originating-IP: [71.185.163.243] In-Reply-To: References: <50435ABE.4010308@ajf.me> <50436412.7010802@ajf.me> <5043C3E9.2010105@ajf.me> <5043C5AF.3060701@ajf.me> <5043C74C.8020400@ajf.me> <5043D8C0.3020802@lsces.co.uk> <5044715E.3050504@rotorised.com> Date: Mon, 3 Sep 2012 08:01:29 -0400 Message-ID: To: Pierre Joye Cc: Ryan McCue , internals@lists.php.net Content-Type: multipart/alternative; boundary=14dae9d24d30ec0bd904c8cae6be X-Gm-Message-State: ALoCoQmd5p9PMFOEbqt8H1IW2PW6zZEXOLYKl5jp5gaBf7hfQcpDA3QIiOGUqBrGbyfIJMbUaIIt Subject: Re: [PHP-DEV] RFC for Adding __toString to DateTime From: wfitch@meetme.com (Will Fitch) --14dae9d24d30ec0bd904c8cae6be Content-Type: text/plain; charset=ISO-8859-1 On Mon, Sep 3, 2012 at 7:57 AM, Pierre Joye wrote: > hi Will, > > On Mon, Sep 3, 2012 at 1:51 PM, Will Fitch wrote: > > On Mon, Sep 3, 2012 at 4:59 AM, Ryan McCue wrote: > > > >> As far as I can tell, there's no standard which uses the Olson database > >> to specify the timezone, so we'd have to create one. > >> > >> What about ISO8601 with the Olson timezone suffixed? > >> > >> 2012-09-02T18:17:36+0100 (Europe/London) > >> 2012-09-02T18:19:05+0100 (Africa/Niamey) > >> > > > > Disagree - The ISO8601 provides a good *string* representation of the > > object. If you want every aspect of the entire object, including the > > properties which are also objects, serialize it. > > I don't think you will ever get a consensus on that. The reason is > that this case falls in the same fall than the timezone itself (but > per instance of an object instead of globally). > > I'd to suggest to force the definition of a format using the > setStringFormat (or whatever will be the name of this function). > __toString will then fail if no format has been set, warning and > returns NULL (f.e.). > I actually feel a static function which tracks globally would best serve this case: date_default_format_set('c') This would prevent the need for setting it on a per instance basis - similar to the way timezones can be set: date_default_timezone_set('America/Chicago') > > Cheers, > -- > Pierre > > @pierrejoye | http://blog.thepimp.net | http://www.libgd.org > --14dae9d24d30ec0bd904c8cae6be--