Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66470 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64261 invoked from network); 5 Mar 2013 15:03:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Mar 2013 15:03:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=njaguar@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=njaguar@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: njaguar@gmail.com X-Host-Fingerprint: 209.85.215.42 mail-la0-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:64992] helo=mail-la0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/F0-58003-E3906315 for ; Tue, 05 Mar 2013 10:03:27 -0500 Received: by mail-la0-f42.google.com with SMTP id fe20so6293900lab.1 for ; Tue, 05 Mar 2013 07:03:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=BPz+86YAhY5OXsDholXecphILaebb7M2OgpwYcNTR5g=; b=q/1r8Xgg/oc3kP/vfC9CvuCXOgZ/NLqVAwt0X1SFRVSdp1VrdWjEN57gdiXAcwlbFj rGG4sjI5NCuD3oAiAE2ZC9wyhMFvEMpCVBK8yHRtjwqwhcZch3EvymZNQtnIDe7zL1/A bdwXgzMaMYpga6x/PuCA6KdML04pYwNKyqr3/kX5JiFfj6+rrWLYxTitTXXFD1ae8Sf0 BYubjPdwKZIAY1wGAld42E2QFZHomCw5Mp61NLOBSQpF0Ibq9uOjQK3+l1G2gNRQAsoa cs5QN5IsUskowFpo34SjEg+QERbhYPcypUXfII6T7SaOGjDo4oFrCswzVdrB1MbRDimb 3VXA== MIME-Version: 1.0 X-Received: by 10.152.46.131 with SMTP id v3mr21684167lam.57.1362495802968; Tue, 05 Mar 2013 07:03:22 -0800 (PST) Received: by 10.152.146.106 with HTTP; Tue, 5 Mar 2013 07:03:22 -0800 (PST) In-Reply-To: References: <5122F37F.2030706@sugarcrm.com> Date: Tue, 5 Mar 2013 09:03:22 -0600 Message-ID: To: David Soria Parra Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Getting separate outputs with Date Functions From: njaguar@gmail.com (Paul Taulborg) On Wed, Feb 20, 2013 at 1:54 PM, David Soria Parra wrote: > On 2013-02-19, Stas Malyshev wrote: >> Hi! >> >>> echo date_create('@1361240634')->format('Y-m-d'); >>> // output: 2013-02-19 >>> >>> echo date('Y-m-d',1361240634); >>> // output: 2013-02-18 >> >> timestamp dates are created with UTC TZ, date() assumes your configured TZ. > > I ran into this myself and I personally consider date() assuming your > configured TZ A bug. Timestamps are defined as UTC and the behaviour of > DateTime is correct there, that it always assume UTC. date() should do > the same. But then date() behaviour has been that way since ages > and probably a lot of code out there is assuming the current TZ when > using date(). > Hi David, I made a patch for a similar issue here: https://bugs.php.net/bug.php?id=63615 I wonder if this would fix your issue as well. I pulled it as a random bug fix, but did note that there is some discrepancy on whether this is intended behavior or not. I'm with Stas that we should either fix it and make it consistent, or document why it isn't.