PHP change date format -
i have date monthpicker in format: 2014 april , , want change 2014-04-01 before inserting mysql. i'm trying use strtotime:
$b = date("y-m-d", strtotime($_post['month'])); echo $b;
result is: 1970-01-01. dont it.
use datetime
$date = new datetime("2014 april"); echo $date->format("y-m-d");
Comments
Post a Comment