php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31539 wrong date/time in 1942 and before
Submitted: 2005-01-13 16:19 UTC Modified: 2005-01-13 21:10 UTC
From: stephan at terrazur dot nl Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.0.3 OS: Debian GNU Linux Sid
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: stephan at terrazur dot nl
New email:
PHP Version: OS:

 

 [2005-01-13 16:19 UTC] stephan at terrazur dot nl
Description:
------------
When using timestamps in date/strftime in 1942 or before, php calculates a wrong date. 

The adodb date time library doesn't seem to have this problem.

Reproduce code:
---------------
/* the wrong result */
$time = adodb_mktime(0,0,0,11,30,1939);
echo date("d-m-Y H:i",$time);

/* the good result with datetime library */
/* http://phplens.com/phpeverywhere/adodb_date_library */
//echo adodb_date("d-m-Y H:i",$time);

Expected result:
----------------
screen output: 30-11-1939 00:00

Actual result:
--------------
screen output: 29-11-1939 23:20

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-13 21:10 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

also, see http://php.net/time
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 10:01:30 2025 UTC