title: Converting to a date format in Mule using DataWeave
body: <p>My requirement is to convert a string to a date format using DataWeave in Mule</p>
  
  <p>Input string </p>
  
  <pre><code>8/30/2015  4:00:13 PM
  </code></pre>
  
  <p>Output date needs to be in MM/DD/YYYY format i.e,</p>
  
  <pre><code>08/30/2015 
  </code></pre>
  
  <p>i have tried using the below logic</p>
  
  <pre><code>(($[1] splitBy " ")[0]) as :date{format:"[m01]/[d01]/[y0001]"} 
  </code></pre>
  
  <p>this gave the error </p>
  
  <pre><code>Exception while executing: 
  "Order Date":(($[1] splitBy " ")[0]) as :date{format:"[m01]/[d01]/[y0001]"},
   Cannot coerce a :string to a :date                                                                                                                                                          ^
  </code></pre>
  
  <p>I am using Mule Anypoint Studio Version: 5.2.0</p>