Bug #53764 [Opn->Bgs]: date with timestamp = 0
| From: | aharvey@php.net | Date: | Mon, 17 Jan 2011 07:31:47 +0000 |
| Subject: | Bug #53764 [Opn->Bgs]: date with timestamp = 0 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-157946@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53764&edit=1
ID: 53764
Updated by: aharvey@php.net
Reported by: daedal13 at gmail dot com
Summary: date with timestamp = 0
-Status: Open
+Status: Bogus
Type: Bug
Package: Date/time related
Operating System: Linux
PHP Version: 5.2.17
Block user comment: N
Private report: N
New Comment:
UNIX timestamp 0 is defined as 0:00:00 on January 1, 1970 in the UTC
time zone.
Since your time zone is three hours ahead of UTC, the same time occurred
at 3 am
in your local time zone.
Previous Comments:
------------------------------------------------------------------------
[2011-01-17 07:39:04] daedal13 at gmail dot com
Description:
------------
Hello. I have catched strange behavior of php.
If 2nd argument of function date(or strftime) is 0, this function add
some hours to result.
For example, in Moscow they add 3 hours (difference between GMT).
Is it true ?
Test script:
---------------
echo date('c', time()) . "\n";
echo date('c', time() - time()) . "\n";
Expected result:
----------------
2011-01-17T09:34:00+03:00
1970-01-01T00:00:00+03:00
Actual result:
--------------
2011-01-17T09:34:00+03:00
1970-01-01T03:00:00+03:00
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53764&edit=1