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