[SOLVED] update query to time fields
Posted: Tue Mar 01, 2005 2:20 pm
I have some fields of type: time in my MySQL db and I'm trying to update them with a sql query that I'm running on a form action page:
I've tried this:
and this:
but when something like "11:00 am" to "2:00 pm" gets entered it displays as 1:00 am.
I know I could check the string to see if it has am or pm in it and then convert it to a 24 hour format...but what's the fun in that??
shouldn't date() and strtotime() be doing this for me?
Burr
I've tried this:
Code: Select all
starttime = '".date("h:i a",strtotime($_POSTї'starttime']))."',
starttime = '".date("h:i a",strtotime($_POSTї'endtime']))."'Code: Select all
starttime = '".date("G:i",strtotime($_POSTї'starttime']))."',
starttime = '".date("G:i",strtotime($_POSTї'endtime']))."'I know I could check the string to see if it has am or pm in it and then convert it to a 24 hour format...but what's the fun in that??
shouldn't date() and strtotime() be doing this for me?
Burr