I am trying to insert datetime into a mysql database and it's not storing the AM or PM.
This is the code I am inserting into the database:
$date = date('Y-m-d h:i:s A');
And the field in the database is a "datetime" field. What am I missing??
A datetime field stores the value as a 24-hour clock value: yyyy-mm-dd hh:mm:ss where "hh" is a value between "00" and "23". (Actually, it may store it in some more compact and efficient internal format, but that's what you'll retrieve from it.) If you need it in 12-hour format with am/pm indicators, you can either use the formatting function your DBMS supplies when you do a query, or format it on the PHP side with the date() function.
I got it to work now except for one thing. I inserted the record at 8:43 pm and it says I inserted it at 11:43 pm. Is this a timezone issue and how do I fix that?