Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62837 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31299 invoked from network); 5 Sep 2012 14:49:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Sep 2012 14:49:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=wfitch@meetme.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=wfitch@meetme.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain meetme.com designates 74.125.149.149 as permitted sender) X-PHP-List-Original-Sender: wfitch@meetme.com X-Host-Fingerprint: 74.125.149.149 na3sys009aog123.obsmtp.com Linux 2.5 (sometimes 2.4) (4) Received: from [74.125.149.149] ([74.125.149.149:59936] helo=na3sys009aog123.obsmtp.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 91/16-12568-67667405 for ; Wed, 05 Sep 2012 10:49:27 -0400 Received: from mail-vc0-f170.google.com ([209.85.220.170]) (using TLSv1) by na3sys009aob123.postini.com ([74.125.148.12]) with SMTP ID DSNKUEdmdOR5qqXsXVM0YD3NvbyOfsffOuGW@postini.com; Wed, 05 Sep 2012 07:49:27 PDT Received: by vchn11 with SMTP id n11so944482vch.29 for ; Wed, 05 Sep 2012 07:49:23 -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=sxWTEDHawJc6nximeaqR/1dstjORL1FaW6JP934r7xI=; b=bl6Sur6wB/fRCVGC+7ZL47iraM6A0gCUPnKOTxChL+NwEiRUO2q7iCAB5nzgo8MHss HhY4y112/BoPXIISER12G9TISUIdyLYp39WaA8haiSts5J/FslzZFHrNbZPPgtMcHIWV cUWykRRj6S9CWRTljLxfyeBJs13dtt47cuhcNNtSHrvqO1JuaV8jrmgXAIkZ/zqmXvVV hmYGy7Lc5UcOMiuoY/tTB4FXfNKHvT6OaoM+/PEVh+6qOpNeU/8sNB8JBj8BqBMZM+nl kNEolnL3lkm/xgbEwT2ev6bpxNjGhHveJvIKjqkjcmdr110A96fifEv50Vn/iCaiKiQU GCXQ== MIME-Version: 1.0 Received: by 10.58.163.36 with SMTP id yf4mr2977238veb.42.1346856562947; Wed, 05 Sep 2012 07:49:22 -0700 (PDT) Received: by 10.58.132.161 with HTTP; Wed, 5 Sep 2012 07:49:22 -0700 (PDT) X-Originating-IP: [204.145.120.11] In-Reply-To: <504709CE.1000004@lsces.co.uk> References: <50436412.7010802@ajf.me> <5043C3E9.2010105@ajf.me> <5043C5AF.3060701@ajf.me> <5043C74C.8020400@ajf.me> <5043D8C0.3020802@lsces.co.uk> <5044A261.10901@lsces.co.uk> <504709CE.1000004@lsces.co.uk> Date: Wed, 5 Sep 2012 10:49:22 -0400 Message-ID: To: Lester Caine Cc: "internals@lists.php.net >> PHP internals" Content-Type: multipart/alternative; boundary=047d7b67233aff782e04c8f57a0e X-Gm-Message-State: ALoCoQn5TZRFMUdo0IzhTbCfmxfr5+facN40ZR7rENt8IdRjnvGUgHX0zvsU+pL1Rwr+YdPRSt8O Subject: Re: [PHP-DEV] RFC for Adding __toString to DateTime From: wfitch@meetme.com (Will Fitch) --047d7b67233aff782e04c8f57a0e Content-Type: text/plain; charset=ISO-8859-1 On Wed, Sep 5, 2012 at 4:14 AM, Lester Caine wrote: > Will Fitch wrote: > >> Hi, Lester - I'll update the patch and RFC to include this format. This >> is the >> format I'll use unless others have a better approach: >> >> 2012-09-01T00:00:00-0500 (America/Chicago) >> > > Just working through another backlog of 'todo' items. > > Your current RFC includes -0500 in the examples, but that is purely due to > your own setup. This is the real problem here since you can't take a > date/time string and clone a new object. You have to define a DateTimeZone > object prior to creating the DaTime object. You have 'America/Chicago' set > as your default timezone, and that is fine for your local working, but part > of Derick's objection is that how this all hangs together is always a two > stage process. > > Now if you can make the above string clone a matching > DateTime/DateTimeZone object pair, then part of the objection would go, but > *I* would still object to any default here since it's just as likely you > want to leave the timezone off and handle it separately as include it in an > output string. > > Also it is worth noting that DateTime::__construct specifically ignores > the $timezone parameter when the date string includes an offset! This may > well be considered a bug and perhaps $timezone parameter should take > priority, but it's all these little things that get missed when one 'just > fills in a missing function' ... someone just taking the default string and > trying to create a new date object for a different timezone might get > caught out, so that particular point should be included in any > documentation. Actually currently the returned string would not work anyway? > The format being suggested (ISO8601 + TZ name) won't work without addressing the concern you mentioned as well as correctly parsing the TZ name. > > The RFC is 'needs more work' but I still feel that adding this 'shortcut' > will create more problems than it will provide any benefit. I'm currently working on revamping the RFC and offering up two separate solutions. You are right that it's going to be difficult to please everyone, but I do want a solution that can be acceptable to most. If that ends up being no solution at all, so be it. I do believe through enough conversation and potentially adjusting DateTime's current behavior (e.g. the TZ point you brought up), a solution can be reached. It's important to keep one of Derick's points in mind as well - https://wiki.php.net/rfc/datetime_and_daylight_saving_time. > > > -- > Lester Caine - G8HFL > ----------------------------- > Contact - http://lsces.co.uk/wiki/?page=**contact > L.S.Caine Electronic Services - http://lsces.co.uk > EnquirySolve - http://enquirysolve.com/ > Model Engineers Digital Workshop - http://medw.co.uk > Rainbow Digital Media - http://rainbowdigitalmedia.co.**uk > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --047d7b67233aff782e04c8f57a0e--