Concept only: I have a form that has two fields:
- Time (ex: user input would be 9:15)
- AM / PM selection
The problem I anticipate is how PHP will display the results correctly since it cannot differentiate AM / PM if I just store the result in MySQL as, for example, "9:15 AM"
So my question is, how do I take user inputted times and AM / PM and store / retrieve properly?
PHP Time
Moderator: General Moderators
Re: PHP Time
I would use 24-hour clock...
Re: PHP Time
If you need to compare the time values with eachother, or perform other logic on them, store the times as a linux timestamp (e.g. with mktime).
If not, just store the time as a string however the user enters it.
If not, just store the time as a string however the user enters it.