Convert any date format into yyyy/mm/dd

How can I convert any user inputted date into yyyy/mm/dd ?

For example user can input date one of the following 20120121 , 2012-01-21 ,01/21/2012,01/21/2012 etc

But I need to convert any of the date entered by user into yyyy/mm/dd (2012/01/2012). Any suggestion. Thanks in advance

this is the script I was using
echo "Please enter the date: "
read X
a=$X+"%y/%m/%d"
echo $a

You already had an identical thread to this closed.

Please check out this thread, Date Parsing