How to convert the date into paticular format using PHP?

Cha0sBG

New Member
I am having the input box for getting the value in mm-dd-yyyy format.So When I get the date I try to covert it into YYYY-MM-DD format.But It doesnt work.
For Example :
\[code\]<?$birthdate="08-13-2000";$date=date('Y-m-d',strtotime($birthdate));echo $date;?>\[/code\].Output is \[code\]1970-01-01\[/code\].
But If I gave \[code\]13-08-2000\[/code\] I got \[code\]2000-08-13\[/code\].\[code\]I dont want to split\[/code\].Because in my application I used in manyplaces like this.But I think the \[code\]strtotime\[/code\] convert it into unix timestamp format even whatever the value.That's why I am try to do like.What's wrong I am understanding or doing?
Thanks in advance.
 
Back
Top