Possible Duplicate:
PHP - How can I check if the current date/time is past a set date/time?
I have a drop down menu below where it shows an exam's name, date and time.
$sessionHTML = '<select name="session" id="sessionsDrop">'.PHP_EOL;
$sessionHTML .= '<option value="">Please Select</option>'.PHP_EOL;
while ( $sessionqrystmt->fetch() ) {
$sessionHTML .= sprintf("<option value='%s'>%s - %s - %s</option>", $dbSessionId, $dbSessionName, date("d-m-Y",strtotime($dbSessionDate)), $dbSessionTime) . PHP_EOL;
}
$sessionHTML .= '</select>';
What I want to do is that if an exam's date and time is passed the current date and time, then display the text of those options in red, if they have not been passed make those options green color text.
E.g Current Date/Time: 24/09/2012 09:00:00 (this is just an example, I want the actual current date and time.
AAA - 13/08/2012 - This text should be red
BVF - 27/01/2013 - This text should be green
Does anyone know how to do this?