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

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -