title: Get-Date from variable in the format of "ddd mmm dd HH:MM:SS yyyy"
body: <p>I am writing a script to email specific people based on errors in an error log. I am doing this in specific intervals and am trying to write a compare function. </p>
  
  <p>Before I do this, however, I will need to pull the date out of the error logs. The first 24 characters of each line in the error log is a date, in the format of <code>ddd mmm dd HH:MM:SS yyyy</code>. I have been able to parse (using the <code>Substring()</code> method) the first 24 characters out of the error line.</p>
  
  <p>what my end goal is, is to compare each date in each line in the error log, with a dynamic date value, to find where the last time the script ran left off.</p>
  
  <p><strong>Edit:</strong> my question is how do I get a string that is in a variable, into a date format that I can then compare against.</p>
  
  <p>I cant seem to get anything to work, the string that is in the variable (for troubleshooting purposes) is Mon Aug 24 21:01:52 2015</p>