php - How convert and save date as mysql format? -



php - How convert and save date as mysql format? -

have form , consist of 10 date fields, , user can pick upto 10 dates. picking in format 'd, d m, y'. how can convert format mysql date format , save database....

<input type='text' name='day1' id='datepicker1' value='' maxlength="50" style="color:#999999" readonly="readonly"/> <input type='text' name='day2' id='datepicker2' value='' maxlength="50" style="color:#999999" readonly="readonly"/>

if utilize strtotime, can convert date timestamp, , reformat mysql using date.

example:

$day1 = strtotime($_request['day1']); $day1sql = date('y-m-d h:i:s', $day1);

you want utilize $day1sql insert mysql. repeat other dates. more information, have @ this.

php jquery mysql

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -