title: How to validate date in R
body: <p>I have a date in the format <code>dd-mm-yyyy HH:mm:ss</code>
  What is the best and easiest way to validate this date?</p>
  
  <p>I tried </p>
  
  <pre><code>d &lt;- format.Date(date, format="%d-%m-%Y %H:%M:%S")
  </code></pre>
  
  <p>But how can I catch the error when an illegal date is passed?</p>