title: Ensuring a string is of a time or date format?
body: <p>I have a method which parses a string in to a date, but i want to validate that i don't try to parse a non numeric string or a string which dosent represent a date or time format?</p>
  
  <p>how can id o this?</p>
  
  <p>at the moment i have: </p>
  
  <pre><code>if(string=~ /^\D*$/ )
  {
  return false
  else 
  do something_else
  }
  </code></pre>
  
  <p>this was fine for a non numeric string like <code>"UNKNOWN"</code> but wouldn't work for <code>"UNKNOWN1"</code></p>
  
  <p>any idea what i can use to make sure that only date or time formats are parsed? </p>