title: APEX date validation ( YYYY-MM-DD-HH24:MI:SS) using regular expression in javascript
body: <p>I have following code to validate date in format DD.MM.YYYY using regular expression for javascript.I am using this code to validate date in dynamic action on APEX5.0</p>
  
  <pre><code>var date_from      = $v('P5_NEW_8');  
  var v_valid_from  = date_from.match(/^(0[1-9]|[12][0-9]|3[01])[.](0[1-9]|1[012])[.](19|20)\d\d$/);  
  var date_to        = $v('P5_NEW_8_1');  
  var v_valid_to    = date_to.match(/^(0[1-9]|[12][0-9]|3[01])[.](0[1-9]|1[012])[.](19|20)\d\d$/);  
  if (!v_valid_from)  
  alert('Date from is in wrong format. Must be DD.MM.YYYY.');  
  if (!v_valid_to)  
  alert('Date to is in wrong format. Must be DD.MM.YYYY.');  
  </code></pre>
  
  <p>where P5_NEW_8 and P5_NEW_8_1 are the items for from date and start date in APEX.
  I want to modify above code for format "YYYY-MM-DD-HH24:MI:SS" .
  Please help.</p>