Bug #66790 [Opn->Nab]: Convert date 0001-01-01 to unix timestamp
| From: | derick@php.net | Date: | Mon, 05 Apr 2021 15:42:48 +0000 |
| Subject: | Bug #66790 [Opn->Nab]: Convert date 0001-01-01 to unix timestamp | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-233168@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66790&edit=1
ID: 66790
Updated by: derick@php.net
Reported by: lampacz at gmail dot com
Summary: Convert date 0001-01-01 to unix timestamp
-Status: Open
+Status: Not a bug
Type: Bug
Package: Date/time related
Operating System: Debian
PHP Version: 5.4.25
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP --
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
Previous Comments:
------------------------------------------------------------------------
[2014-03-26 22:27:34] pedro dot bicudo at tgtconsult dot com dot br
Same code returns different results after php update:
$date=date_create("2014-01-01");echo date_timestamp_get($date);
php 5.3.26 returns 1388534400
php 5.3.28 returns 1388541600
$date=date_create("2014-06-14");echo date_timestamp_get($date);
php 5.3.26 returns 1402704000
php 5.3.28 returns 1402714800
this bug displays one day difference on screen depending on timezone
------------------------------------------------------------------------
[2014-02-27 12:29:07] lampacz at gmail dot com
Description:
------------
strtotime("0001-01-01") returns -62135600400
Bash (date -d '0001-01-01' "+%s") returns -62135600264
Postgres (select extract(epoch from timestamp '0001-01-01');) returns -62135600264
of course 64bit system
Test script:
---------------
echo strtotime("0001-01-01")
Expected result:
----------------
-62135600264
Actual result:
--------------
-62135600400
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66790&edit=1