I am having difficulty adding days, hours, and minutes through strtotime()
.
Code:
$uncleanTotal = strtotime($created_time);
$uncleanTotal = strtotime("+".$timeForUnclean[0] . " days ". $timeForUnclean[1] ." hours ". $timeForUnclean[2] ." minutes");
To be more exact I am trying to get a time from before and add days, hours, and minutes to see if that time it creates is greater than the current time (now) or lesser than. I am than using an if
statement to check this.
Code:
if($cautionTotal <= $now)
{
echo "working caution";
return "yellow";
}
else if( $uncleanTotal <= $now)
{
echo "working unclean";
return "red";
}
else if($cautionTotal > $now && $uncleanTotal > $now)
{
echo "working clean";
return "green";
}
Suggestions? Thoughts?