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

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -