PHP Code:
<select id=hour name=hour>
<option value="13">12:00 am</option>
<option value="14">1:00 pm</option>
</select>
I would say you need to keep your return values as close as possible to your intended final use as possible.
An hour can best be handled as a number.
On the backend, when the form is posted you can then more easily:
1 check that hour is only an integer between 1 and 24
for example:
PHP Code:
if ( $hour >0 && $hour <= 24 ) {
echo "good hour " . date("F j, Y, g:i a", mktime( 0,0, $hour,12,3,2008));
}
2 you can then use that in your time check or to select things from your database
"select things from yourTable where datefield > 2008-03-12 $hour:00:00 " ;
PHP Code:
<option value="12pm">12:00 pm</option>
Using "12pm" as the value means you then have to strip off the "pm", presumably after working out which 12 it was.
The same would be true for other date and time elements.
PHP Code:
<option value="2008-03-12">Thu 3 December</option>
HTH
Bookmarks