|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70694 When using the date function, I have a problem
Submitted: 2015-10-12 08:59 UTC Modified: 2015-10-12 09:21 UTC
From: bear dot gan at qq dot com Assigned:
Status: Not a bug Package: Calendar related
PHP Version: 5.4Git-2015-10-12 (Git) OS: ubuntu 14 ,windows
Private report: No CVE-ID: None
 [2015-10-12 08:59 UTC] bear dot gan at qq dot com
When using the date function, I have a problem, set up a date 2099/3/31, the results in the conversion of PHP

$t = '2099-3-31 0:0:0';
$time = strtotime($t);
echo $time.': '.date('Y-m-d H:i:s', $time).'<br>';

The result of echo is 00:00:00 1970-01-01

Test script:
$t = '2099-3-31 0:0:0';
$time = strtotime($t);
echo $time.': '.date('Y-m-d H:i:s', $time).'<br>';

Expected result:
[echo]The result of echo is  1970-01-01 00:00:00

Actual result:
2099-3-31 0:0:0


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-12 09:00 UTC]
-Package: PHP Language Specification +Package: Calendar related
 [2015-10-12 09:21 UTC]
-Status: Open +Status: Not a bug
 [2015-10-12 09:21 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

You are on windows, which only supports 32 bit integers. The timestamp for "2099-3-31" would fall outside of the 32-bit range, which runs out somewhere in 2038. What you want to do is:

$dt = new DateTime("2099-3-31 0:0:0");
echo $dt->format("Y-m-d H:i:s");
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Mar 03 02:01:30 2024 UTC