Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66072 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85914 invoked from network); 20 Feb 2013 19:54:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Feb 2013 19:54:19 -0000 X-Host-Fingerprint: 217.114.211.68 unknown Date: Wed, 20 Feb 2013 14:54:18 -0500 Received: from [217.114.211.68] ([217.114.211.68:3187] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/00-20257-9E925215 for ; Wed, 20 Feb 2013 14:54:18 -0500 To: internals@lists.php.net References: <5122F37F.2030706@sugarcrm.com> User-Agent: slrn/0.9.9p1 (SunOS) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: X-Posted-By: 217.114.211.68 Subject: Re: [PHP-DEV] Getting separate outputs with Date Functions From: dsp@php.net (David Soria Parra) 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().