I got this result when performing this code 1970 Aug 20
$x = date("Y M d", "20010921"); echo("$x");
why is that ? it suppose to be 2001 September 21
what should i do to get this result 2001 September 21
Date() takes an epoch timestamp (seconds since Jan 1st 1970) not a string vaguely resembling a timestamp.
Read about date() and mktime() in the manual.
so what do you think the best way to get the new date, with that
echo date('Y M d', mktime(0,0,0,1,21,2001));