Code: Select all
$today = (date('Y-m-d'));
$todaydate = strtotime($today);
$tolddate = strtotime($row->winnerinformeddate);
$finaldate = strtotime('+30 days', $tolddate);
if ($finaldate <= $todaydate)
{ echo "do this";}
else { echo "do that"; }
The user has 30 days to update it.
So $finaldate is meant to work out an additional 30 days onto the $row->winnerinformeddate.
Thing is, $finaldate is coming out LOWER that $todaydate, even though the $row->winnerinformeddate in the field is actually lower (ie. 18 May. So easily outside the 30 days.
How have I coded this wrong?
If I render the variables, these are what come out, and I don't understand the maths.
[text]$todaydate = 2010-06-22 / 1276815600
$finaldate = 2010-06-18 / 1277161200[/text]
How can $todaydate actually have a lower figure than $finaldate, when $todaydate is greater?