Re: [PHP-DB] Time input formatting in PHP-12 hour clock

2003-06-22 Thread David Shugarts
With help from the List, I have had some success in answering my question about formatting 12-hr vs. 24-hr time and I thought I would share these two examples of what is working for me. The first example keeps the user from inputting invalid data. In the second, I note that an error yields a -1

Re: [PHP-DB] Time input formatting in PHP-12 hour clock

2003-06-13 Thread Ronan Chilvers
Hi David Comments inline... On 13 Jun,2003 at 10:26 David Shugarts wrote: snip PHP--I need the user to be able to input a time, then validate it as to whether it is complete (e.g., expresses AM or PM and evaluates correctly), then pass it into an INSERT statement into the time field of a

RE: [PHP-DB] Time input formatting in PHP-12 hour clock

2003-06-13 Thread Carl Furst
There are several ways you can do it. But the first step is to translate to 24 hour time. So the first thing we have to check is if the am or pm flag was set. Then add 12 hours or leave as is OR set the hour to 00 (midnight). Something like this may help: Switch(strtoupper($ampm_flag)) { // if