php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37317 mktime problem
Submitted: 2006-05-04 23:20 UTC Modified: 2006-05-04 23:48 UTC
From: ramsessivira at yahoo dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.1.3 OS: windows xp
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ramsessivira at yahoo dot com
New email:
PHP Version: OS:

 

 [2006-05-04 23:20 UTC] ramsessivira at yahoo dot com
Description:
------------
For years up to 2038 the mktime instruction does not give back any result

Reproduce code:
---------------
for($x=2037;$x<2041;$x++){
  echo mktime(0,0,0,1,1,$x)."   Date:  ".date( "M-d-Y",mktime(0,0,0,1,1,$x))."<br>";
}


Expected result:
----------------
2114395200 Date: Jan-01-2037
2145931200 Date: Jan-01-2038
some value Date: Jan-01-2039
some value Date: Jan-01-2040

Actual result:
--------------
2114395200 Date: Jan-01-2037
2145931200 Date: Jan-01-2038
Date: Dec-31-1969
Date: Dec-31-1969

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-04 23:22 UTC] tony2001@php.net
Yes, because in 2038 integer overflow is going to happen.
 [2006-05-04 23:48 UTC] ramsessivira at yahoo dot com
What can i do to fix the problem?
I am trying to calculate the age being started off of the birthday
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 02 06:01:28 2024 UTC