title: Check if date is in given format with Javascript
body: <p>How can I check if date is in given format or not. It must be function like this</p>
  
  <pre><code>function isInGivenFormat(date,format)
  {
  //some checking
  }
  </code></pre>
  
  <p>For example, <code>isInGivenFormat("12:45:02","hh:mm:ss")</code> must return true and <code>isInGivenFormat("12:45:02 PM","hh:mm:ss")</code> must return false.<br>
  How can I achive this functionality with Javascript/Jquery?</p>