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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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: Thu Oct 31 23:01:28 2024 UTC