php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32452 Compare dates impossible with mktime
Submitted: 2005-03-25 12:15 UTC Modified: 2005-03-25 12:24 UTC
From: arnoud dot kettenis at planet dot nl Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.3.10 OS: Windows 2000
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: arnoud dot kettenis at planet dot nl
New email:
PHP Version: OS:

 

 [2005-03-25 12:15 UTC] arnoud dot kettenis at planet dot nl
Description:
------------
Compare dates impossible with mktime. All if-statements return true, no matter the date.

Reproduce code:
---------------
<?php
$event_fromdate = date("Y-m-d", mktime(0, 0, 0, 5, 1, 2005));
$event_todate = date("Y-m-d", mktime(0, 0, 0, 5, 10, 2005));
if ($event_todate >= $event_formdate) {echo ("<p>equal or larger</p>\n");}else {echo ("<p>smaller</p>\n");}

$event_todate = date("Y-m-d", mktime(0, 0, 0, 5, 1, 2005));
if ($event_todate >= $event_formdate) {echo ("<p>equal or larger</p>\n");}else {echo ("<p>smaller</p>\n");}

$event_todate = date("Y-m-d", mktime(0, 0, 0, 4, 10, 2003));
if ($event_todate >= $event_formdate) {echo ("<p>equal or larger</p>\n");}else {echo ("<p>smaller</p>\n");}
?>

Expected result:
----------------
equal or larger

equal or larger

smaller


Actual result:
--------------
equal or larger

equal or larger

equal or larger


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-25 12:19 UTC] arnoud dot kettenis at planet dot nl
No error-
 [2005-03-25 12:22 UTC] arnoud dot kettenis at planet dot nl
used $event_formdate in stead of $event_fromdate ...

i'm sorry!!
 [2005-03-25 12:24 UTC] pajoye@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

> bogus
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Aug 11 18:00:03 2025 UTC