title: Change Date format in Excel VBA
body: <p>I have the Date in the log file. The Date in the log file looks something like this :</p>
  
  <blockquote>
    <p>Mon May 14 21:31:00 EDT 2012</p>
  </blockquote>
  
  <p>I would like to convert this into the format "dd-MM-yyyy hh:mm:ss"</p>
  
  <pre><code>Dim DateVal1 As String 
  Dim Date1 As Date
  
  DateVal1 = "Mon May 14 21:31:00 EDT 2012"
  
  Date1 = Format(DateVal,  "ddd mmm dd  hh:mm:ss EDT yyyy")
  Date1 = Format(Date1 , "dd-MM-yyyy hh:mm:ss")
  </code></pre>
  
  <p>The following code is not converting into the format that I was expecting. Any Idea, If I am missing something here.</p>
  
  <p>Thanks</p>