#28399 [Bgs]: Getting unixtime since 12/31/1969 21:00:00
| From: | mgf@php.net | Date: | Fri, 14 May 2004 13:49:50 +0000 |
| Subject: | #28399 [Bgs]: Getting unixtime since 12/31/1969 21:00:00 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-59631@lists.php.net to get a copy of this message | ||
ID: 28399
Updated by: mgf@php.net
Reported By: vinicius at teracom dot com dot br
Status: Bogus
Bug Type: Date/time related
Operating System: Red Hat 8.0
PHP Version: 4.3.4
New Comment:
This is expected behaviour -- the Unix epoch is 1-Jan-1970 00:00 *GMT*,
so a timestamp of 0 of course equates to 31-Dec-1969 21:00 in a
GMT-0300 timezone. This is clearly documented in the same note that
you quote from: "valid range of a timestamp is typically from Fri, 13
Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT"
(See also date()/gmdate(), mktime()/gmmktime().)
Previous Comments:
------------------------------------------------------------------------
[2004-05-14 15:34:19] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
This data is retrieved from your OS, PHP has little to do
with this.
------------------------------------------------------------------------
[2004-05-14 15:23:17] vinicius at teracom dot com dot br
Description:
------------
I was testing unixtime from php and delphi and there is a difference
from one to another.
Php makes unixtime from 12/31/1969 21:00:00. Isn't it a bug? Unixtime
isn't from 01/01/1970 00:00:00 as you say in manual from function
strtotime:
'...This means that e.g. dates prior to Jan 1, 1970 will not work on
Windows, some Linux distributions, and a few other operating
systems....'
If it's because the time, isn't it needed another argument to define
it?
For example:
If i make a script using unixtime using -0300 timezone and, for some
reason, i move it to another system that uses timezone as GMT, some
results will be different.
Reproduce code:
---------------
<?
$unixtime = 0;
echo date("d/m/Y H:i:s", $unixtime) . "\r\n";
?>
Expected result:
----------------
01/01/1970 00:00:00
Actual result:
--------------
31/12/1969 21:00:00
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28399&edit=1