title: Java DateFormat
body: <p>I know Java Date Time is not a good way to go forward but I was just curious as to what's happening:</p>
  
  <p>Why does the following line:</p>
  
  <p><code>DateFormat df = new SimpleDateFormat("dd-MMM-yyyy", Locale.US)</code></p>
  
  <p>not produce any errors and the following lines do:</p>
  
  <p><code>DateFormat df = new SimpleDateFormat("DD-MMM-YYYY", Locale.US)</code></p>
  
  <p><code>DateFormat df = new SimpleDateFormat("dd-mm-YYYY", Locale.US)</code></p>
  
  <p>The following exception gets thrown:</p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalArgumentException: Illegal pattern character 'Y'
  
      at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:769)
      at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:576)
      at java.text.SimpleDateFormat.&lt;init&gt;(SimpleDateFormat.java:501)
      at testing.MySchedule.main(MySchedule.java:18)
  </code></pre>
  
  <p>I mean I'm just changing the case right? but is DateFormat really that dumb or am I doing something wrong? or does it have something to do with the Locale I'm using?</p>
  
  <p>Cheers </p>