Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82593 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75563 invoked from network); 13 Feb 2015 10:21:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Feb 2015 10:21:45 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.45 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.216.45 mail-qa0-f45.google.com Received: from [209.85.216.45] ([209.85.216.45:35126] helo=mail-qa0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/72-62214-830DDD45 for ; Fri, 13 Feb 2015 05:21:45 -0500 Received: by mail-qa0-f45.google.com with SMTP id j7so11750902qaq.4 for ; Fri, 13 Feb 2015 02:21:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=VyllPYcmYhhc6OytPJFgM5Q3llWV+AiXeZwvEKPhFHQ=; b=Vt/1XBYUDyRzcL5CfzeU9uTu93Hq3EPbL6oWcDBhdeO2v4nHQmbQc3wJYtd/8IO31k yQXkuJD1ibflgkOo6y/bAHxaOkIIHYp074gKgmM/8aVLz/DTo0WXSvatmuafxT76NEar goVX9GoGSYVIJLM83EuvOc8S7BCFeHMSFQMv24LdcdTzxS3sMzDRX440F65AQRvwk4h5 OGNc3PTpQdxwKbnMHOLSq6f71aTxJxFMuPahe3tdiYOhi6YrwKJwxhhV5Q8bhQRP+CO8 DRQMLRgVJIWTnyDC2eZTpH2vJ72q4HIU7GB7yYOo/Xs8XzXrOCdm6saRcYsQJFIUTopp GHpw== X-Received: by 10.140.109.164 with SMTP id l33mr21205162qgf.91.1423822901568; Fri, 13 Feb 2015 02:21:41 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.198.8 with HTTP; Fri, 13 Feb 2015 02:21:01 -0800 (PST) In-Reply-To: <54DDC95F.3080102@lsces.co.uk> References: <54DDC95F.3080102@lsces.co.uk> Date: Fri, 13 Feb 2015 19:21:01 +0900 X-Google-Sender-Auth: SEH2H-JAtU49ssw5D6qoXJzSjFE Message-ID: To: Lester Caine Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a113a304e456c2a050ef59ac0 Subject: Re: [PHP-DEV] Legal date generated from illegal date From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a113a304e456c2a050ef59ac0 Content-Type: text/plain; charset=UTF-8 Hi Lester, On Fri, Feb 13, 2015 at 6:52 PM, Lester Caine wrote: > Management of dates is controversial in a lot more areas than just using > the wrong calendar in prior times ;) > Each database uses it's own way to handle dates and time internally, and > most default actions are different, add to which using second as the > base for dates is just wrong anyway, but we have to live with what is > currently available. > The area that needs fixing first is the underlying OS functions rather > than continually trying to patch the top level, but we perhaps need to > document better just where the joins are ... just how many days were > there from 0BC to today ... > I agree. Under MySQL, these strange results from DateTime class would not be stored because MySQL does not handle year less than 1000. Under PostgreSQL, datetime types support 4713 BC to 294276 AD. In addition, PostgreSQL is smart enough that convert 2015-01-32 to 2015-02-01, 0000-00-00 to 0001-01-01 BC, etc. Therefore, these results will be stored as _valid_ date. This is really bad... All invalid date should be invalid. The only possible exception may be 0000-00-00, since many users may rely on this behavior under MySQL. We have exception for unserializing 0000-00-00, though. Anyway, we need DataTime expert here. What do you think Derick? Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a113a304e456c2a050ef59ac0--