Re: Getting separate outputs with Date Functions

From: Date: Wed, 20 Feb 2013 19:54:18 +0000
Subject: Re: Getting separate outputs with Date Functions
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On 2013-02-19, Stas Malyshev <[email protected]> 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().


Thread (6 messages)

« previous php.internals (#66072) next »