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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Sat Jun 01 01:01:35 2024 UTC