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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Tue May 14 13:01:33 2024 UTC