time - 5 minutes
Posted: Mon Nov 08, 2010 11:19 am
I can't quite seem to figure this out.
I have a time which represents a delay (along the lines of 00:05:13).
I then need to know if that delay is greater than 10 minutes.
what I have is:
but this isn't working as no matter what the delay actually is (5 minutes, 1 minute etc.) it always seems to hit the first criteria (should be greater than 10 minutes). I'm guessing it's to do with the "strtotime($d)" query.
I have a time which represents a delay (along the lines of 00:05:13).
I then need to know if that delay is greater than 10 minutes.
what I have is:
Code: Select all
$network = $nw; //identifying name
$d = $del['AvgDelay']; //avearge delay
if
(time() - strtotime($d) > '600') {
print " <tr $colour1>\n";
print " <td>$network</td>\n <td>$d</td>\n";
print " </tr>\n";
}elseif
(time() - strtotime($d) > '320') {
print " <tr $colour3>\n";
print " <td>$network</td>\n <td>$d</td>\n";
print " </tr>\n";
}else {
print " <tr $colour2>\n";
print " <td>$network</td>\n <td>$d</td>\n";
print " </tr>\n";
}