php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1381 mktime overflows (data type -long int- is too small)
Submitted: 1999-05-06 07:59 UTC Modified: 1999-05-06 08:04 UTC
From: diab at diab dot rulez dot org Assigned:
Status: Closed Package: Other
PHP Version: 3.0.7 OS: linux debian potato+2.2.7
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: diab at diab dot rulez dot org
New email:
PHP Version: OS:

 

 [1999-05-06 07:59 UTC] diab at diab dot rulez dot org
int mktime(int hour, int minute, int second, int month, int day, int year);
it returns long integer, but it "wraps" between 2038-2039

<?php echo mktime(0,0,0,1,1,"2038") ?>
result: 2145913200

<?php echo mktime(0,0,0,1,1,"2039") ?>
result: -1

diab



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-05-06 08:04 UTC] andrey at cvs dot php dot net
This is a Unix limitation because of the way the time is represented.
2038 is the year when the number of seconds since 1970 will overflow.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 01 01:01:28 2024 UTC