How can I find what table cell contains time that is nearest the current time?

The time table is created using PHP code like:

```
for ($i = 1; $i <= 24; $i++)
  {
  $timetable=strftime("%X", mktime(0, 0, $hour[$i], $month, $day, $year));
  }

```

With this PHP code I get the time table for current day like:

```
   time   |
----------
 05:09:23 |
----------
 07:23:18 |
----------
 11:55:41 |
----------
 14:01:32 |
----------

```

The thing that I need is to change the background color of cell where the printed time is nearest the current time.

Hos can I do that?