I have a form and I'm trying to decide the best way to ask the user for the time they want to schedule the event. Should I just have a text field or should I use a list with options. I would prefer to ask for the time in 12-hour format and ask whether or not it's AM/PM.
I know I will have to convert the time to 24-hour format. I'm just having trouble working out all the details of getting it from 12-hr to 24-hr so I can post it to the database.
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,686
Thanks: 42
Thanked 637 Times in 625 Posts
I would make a single selection list that contains all the times available (10am, 11am, noon, 1pm, etc) and then use strtotime() to convert it into a "time" data type to store in MySQL.