Jump to content

time


timmah1

Recommended Posts

I have a field in the database that uses 'time'

 

How can I show 12 hour time instead of 24 hour time?

 

I have a drop down menu with time, the value can stay at 24 hour, but what shows, i want that to show 12 hour time, how is this achieved?

 

This is what i have now

for($i=0;$i<=23;$i++){
echo "<option value=" . sprintf("%02d", $i) . ">" . sprintf("%02d", $i) . "</option>";
}

The option value can stay at 24, but for visual, I need it to show 12 hour time to users.

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/122663-time/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.