Hello
I want to convert the date formate from
Wed Jun 15 2011 00:00:00 GMT 0530 (India Standard Time)
to
06/06/2011
I have done something like this
$chkdt = "Wed Jun 15 2011 00:00:00 GMT 0530 (India Standard Time)";
$month = substr($chkdt,4,3);
if($month == 'Jan') $month = '01';
else if($month == 'Feb') $month = '02';
else if($month == 'Mar') $month = '03';
else if($month == 'Apr') $month = '04';
else if($month == 'May') $month = '05';
else if($month == 'Jun') $month = '06';
else if($month == 'Jul') $month = '07';
else if($month == 'Aug') $month = '08';
else if($month == 'Sep') $month = '09';
else if($month == 'Oct') $month = '10';
else if($month == 'Nov') $month = '11';
else if($month == 'Dec') $month = '12';
$date = substr($chkdt,7,3);
$year = substr($chkdt,10,5);
$finaldt = date("m/d/Y", mktime(0, 0, 0, $month, $date, $year));
its working fine and give me the result which i want. but i don't want to use this if condition for the each month. is there any other solution for convert the date in same formate which i want ?
Thanks in advance :)