title: Salesforce Apex: Validating date for format and value
body: <p>I need to validate a date field which is being entered by a user via a visualforce page. 
  The format my code expects is "yyyy-MM-dd".</p>
  
  <p>What is the best way to handle this in apex. I have done similar stuff in Java before using certain standard classes which are not available in Apex like SimpleDateFormat for example. </p>
  
  <p>Now I can check if the "format" is correct using a regular expression. But I must also prevent users from entering "9999-99-99" which satisfies the format. I am hoping Salesforce has a good built-in solution. </p>
  
  <p>Thanks,
  Calvin</p>