title: vb.net String was not recognized as a valid DateTime
body: <p>I have the following function called setdateformat in my VB application. </p>
  
  <pre><code>Public Function SetDateFormat(ByVal ArrayInputString As String) As String
  
     Dim FormattedDateString As String = ""
     Dim DateInput As DateTime = DateTime.Parse(ArrayInputString)
     FormattedDateString = DateInput.ToString("yyyy-MM-dd HH:mm:ss")
     Return FormattedDateString
  
  End Function
  </code></pre>
  
  <p>Its purpose is to format the date, however it keep falling over at the line <code>Dim DateInput As DateTime = DateTime.Parse(ArrayInputString)</code>. I have tried looking around online and investigating but to no avail. I have tried using dateTime.ParseExact but no luck.</p>
  
  <p>Im really struggling to understand why this error is occurring for me to be honest, Hence the reason for this post so any help is much appreciated. </p>
  
  <p>I have debugged the solution but to help anyone reading this understand the following values are being passed in the variables </p>
  
  <p>ArrayInputString = 21/05/2015 09:29:41</p>
  
  <p>Date Time Now = 05/21/2015 09:29:41</p>
  
  <p>Any assistance wil be gladly taken on board</p>
  
  <p>Paul</p>