php - How to convert a date and time to be stored in mysql datetime -


how convert stored in mysql database datetime field?

$phptime = '02/21/2014 9:30 am'; 

convert string timestamp, use php date function in format want.

$datetimestring = date( 'y-m-d h:i:s', strtotime( $phptime ) ); 

Comments

Popular posts from this blog

node.js - StackOverflow API not returning JSON -

python - Subclassed QStyledItemDelegate ignores Stylesheet -

php - Laravel 4.1 to Heroku: SQLSTATE[HY000] [2002] No such file or directory -