php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1285 mktime(2,0,0,4,4,1999) produces result -1
Submitted: 1999-04-03 17:58 UTC Modified: 1999-06-20 20:49 UTC
From: howard at koalanet dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.6 OS: Unix
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: howard at koalanet dot com
New email:
PHP Version: OS:

 

 [1999-04-03 17:58 UTC] howard at koalanet dot com
<html>
<body>
<?
$timenow = time();
$start_north_america = mktime(2,0,0,4,4,1999);
$end_north_america = mktime(2,0,0,10,31,1999);
if ($timenow > $start_north_america && $timenow < $end_north_america){
echo "Yes<BR>";}
else {echo "No<BR>";}
echo "$start_north_america<BR>";
echo $end_north_america;
?>
</body>
</html>

/* mktime(2,0,0,4,3,1999) or mktime(2,0,0,4,5,1999) produces the correct Unix Timestamp result */
/* Only mktime(2,0,0,4,4,1999) produces -1 */
/* You can see it at www.koalanet.com/timetest.html */

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-20 20:49 UTC] jim at cvs dot php dot net
FreeBSD's mktime() function appears to be strict about
times that fall right on the DST cusp. That's who is
returning -1, we're just passing that value on.

gmmktime() should not exhibit this problem (but then
you need to offset based on the time zone).
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 03:00:02 2026 UTC