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

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -