title: Convert any Date format in unix
body: <p>How can I convert any user inputted date into <code>yyyy/mm/dd</code>?</p>
  
  <p>For example, the user may input date in one of the following formats:</p>
  
  <pre><code>20120121
  2012-01-21
  01/21/2012
  01/21/2012
  ...
  </code></pre>
  
  <p>But I need to convert any of the date entered by the user into <code>yyyy/mm/dd (2012/01/2012)</code>. Any suggestion?</p>
  
  <p>Here's what I've been trying, but it is not working:</p>
  
  <pre><code>echo "Please enter the date: " 
  read X 
  a=$X+"%y/%m/%d"
  echo $a
  </code></pre>