jblayney
asked on
my strtotime is negative and wont compare
Hello,
i converted 2 dates into strtotime and am trying to compare which is more recent (greater than)
what happens is that it is dumping the results as a negative and wont compare greater than or equal to.
$dont_display = "false";
$morerecentn = 0;
do {
$inmates = $row_Recordset_inmates['la st_inst_da te'];
$morerecent = $row_Recordset_morerecent[ 'last_inst _date'];
$inmatesn = strtotime($inmates);
$morerecentn = strtotime($morerecent);
echo $inmatesn;
echo $morerecentn;
if ($morerecentn > $inmatesn) {
$dont_display = "true";
}
} while ($row_Recordset_morerecent = mysql_fetch_assoc($Records et_morerec ent));
echo $dont_display;
?>
what i see on the screen is
11168837200-11181016000tru e
the result is false, but for some reason displays as true, and again, why is it displaying as a negative
i converted 2 dates into strtotime and am trying to compare which is more recent (greater than)
what happens is that it is dumping the results as a negative and wont compare greater than or equal to.
$dont_display = "false";
$morerecentn = 0;
do {
$inmates = $row_Recordset_inmates['la
$morerecent = $row_Recordset_morerecent[
$inmatesn = strtotime($inmates);
$morerecentn = strtotime($morerecent);
echo $inmatesn;
echo $morerecentn;
if ($morerecentn > $inmatesn) {
$dont_display = "true";
}
} while ($row_Recordset_morerecent
echo $dont_display;
?>
what i see on the screen is
11168837200-11181016000tru
the result is false, but for some reason displays as true, and again, why is it displaying as a negative
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
please post the result of
echo $inmates.':'.$morerecent;
echo $inmates.':'.$morerecent;
should have refreshed the page before posting :-(
Closed, 125 points refunded.
Vee_Mod
Community Support Moderator
Vee_Mod
Community Support Moderator
http://www.php.net/strtotime