title: PHP date validation similar to ASP isDate() for user submitted dates, times, or date/time pairs
body: <p>I am converting an ASP application to PHP and am having difficulty transcribing date validation functionality.</p>
  
  <p>In ASP, I have the function isDate(), which allows me to validate a date regardless of its format. So if someone enters any of the following, isDate() returns true:</p>
  
  <pre><code>1/1/2012
  January 1, 2012
  Jan 12, 2010 1:00 pm
  1/1/2012 1:32 pm
  </code></pre>
  
  <p>The benefit is that I can let the user enter the data and time in whatever format they choose. After that, with minimal effort, I can update a database without doing any post processing (assuming true is returned). E.g.: </p>
  
  <pre><code>UPDATE my_table SET date_field = @date_var WHERE my_id = @id_var
  [note: SQL Server 2008]
  </code></pre>
  
  <p>With PHP, I’m finding that validating a date/time is more complex. I’ve reviewed the assorted questions posted here as well as the documentation and there doesn’t seem to be a straightforward way to validate a date or time or date/time combination easily.</p>
  
  <p>I’m wondering if there are classes available to do the grunt work. Something that will work like isDate() and send me back a true/false based on a user entered date/time/date &amp; time.</p>
  
  <p>Thanks.</p>