title: how can I check if a variable type is DateTime
body: <p>How can I check if a variable is a datetime type on php, please?
  I've tried this, but it seems doesn't work.</p>
  
  <pre><code>public function setRegistrationDate ($registrationDate) {
  
     if (!is_date($registrationDate, "dd/mm/yyyy hh:mm:ss")) {
         trigger_error('registrationDate != DateTime', E_USER_WARNING);
         return;
     }
  
     $this-&gt;_registrationDate = $registrationDate;
  }
  </code></pre>