Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55869 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55857 invoked from network); 19 Oct 2011 07:18:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Oct 2011 07:18:58 -0000 Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 213.123.26.184 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 213.123.26.184 c2beaomr06.btconnect.com Received: from [213.123.26.184] ([213.123.26.184:4583] helo=mail.btconnect.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BD/3D-46813-ED97E9E4 for ; Wed, 19 Oct 2011 03:18:55 -0400 Received: from host81-138-11-136.in-addr.btopenworld.com (EHLO _10.0.0.4_) ([81.138.11.136]) by c2beaomr06.btconnect.com with ESMTP id EZY06390; Wed, 19 Oct 2011 08:18:50 +0100 (BST) Message-ID: <4E9E79DA.6070404@lsces.co.uk> Date: Wed, 19 Oct 2011 08:18:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110907 Firefox/6.0.2 SeaMonkey/2.3.3 MIME-Version: 1.0 To: PHP Internals List References: <20111018214522.GA10462@panix.com> In-Reply-To: <20111018214522.GA10462@panix.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=tid=0001.0A0B0302.4E9E79DA.0035, actions=TAG X-Junkmail-Premium-Raw: score=7/50, refid=2.7.2:2011.10.19.64514:17:7.586, ip=81.138.11.136, rules=__MOZILLA_MSGID, __HAS_MSGID, __SANE_MSGID, __USER_AGENT, __MIME_VERSION, __TO_MALFORMED_2, __BOUNCE_CHALLENGE_SUBJ, __BOUNCE_NDR_SUBJ_EXEMPT, __CT, __CT_TEXT_PLAIN, __CTE, __ANY_URI, __URI_NO_MAILTO, __CP_URI_IN_BODY, BODYTEXTP_SIZE_3000_LESS, BODY_SIZE_2000_2999, __MIME_TEXT_ONLY, RDNS_GENERIC_POOLED, BODY_SIZE_5000_LESS, RDNS_SUSP_GENERIC, RDNS_SUSP, BODY_SIZE_7000_LESS X-Junkmail-Status: score=10/50, host=c2beaomr06.btconnect.com X-Junkmail-Signature-Raw: score=unknown, refid=str=0001.0A0B020D.4E9E79DC.0041:SCFSTAT14830815,ss=1,fgs=0, ip=0.0.0.0, so=2010-07-22 22:03:31, dmn=2009-09-10 00:05:08, mode=multiengine X-Junkmail-IWF: false Subject: Re: [PHP-DEV] [RFC] DateTime and Daylight Saving Time Transitions From: lester@lsces.co.uk (Lester Caine) Daniel Convissor wrote: > PHP's DateTime class has unexpected outcomes when dealing with the > transitions between Daylight Saving Time and Standard Time. > > Properly defining, documenting and unit testing DateTime's behaviors is > important for PHP's future. This document seeks agreement on what the > expected behaviors should be. > > Please take a moment to review the RFC and post any questions or > concerns here. > > https://wiki.php.net/rfc/datetime_and_daylight_saving_time I feel that it is worth pointing out that handling the transitions is more a matter of making the right design choices in the underlying design. Having had to manage this for many years in timetabling systems for railways, I've come to one simple conclusion, and that is that the internal system always works with UTC times. All of the calculations and 'timing diagrams' therefore have unique and sequential times. The discussion then comes back to mapping UTC times to and from the local times which is a lot easier to manage? Rather than complex maths to try and correct the 'Type3' times, if they are automatically stored internally as a UTC time, and only the displayed information is varied, then the maths problem goes away? This will handle any complex daylight saving offsets cleanly? Having the same mechanism for all time values would also remove the need to have to handle that processing in the application? Moving to multi-timezone applications, by working purely in UTC in the stored data, all that the application requires is to know the timezone of the client ( long time grip - this needs to be provided via the browser! ) or the timezone of the location. Single timezone only really exist if there is no daylight saving in the area being served, and then it simply does not matter if the system is using UTC on the server or the local 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// Firebird - http://www.firebirdsql.org/index.php