title: How to validate any date format pattern itself in Java
body: <p>I just could not find any way to check if the provided pattern is valid or not before validating any date.</p>
  <p>For example</p>
  <pre><code>String datePattern = &quot;blablabla&quot;;
  </code></pre>
  <p>How can we validate if it's a valid pattern to create an object SimpleDateFormat or any other dateFormat.</p>
  <p>Thanks.</p>