title: How to keep Java calendar updated after a modification?
body: <p>I am writing a program that has a header where the current time is displayed. I want to allow the user to modify date/time settings. But after the user modifications I cannot get the calendar to stay up-to-date. It always shows the value entered by the user. For example:</p>
  
  <pre><code>Calendar cal = Calendar.getInstance();
  System.out.println(cal.getTime());
  cal.set(Calendar.MONTH, Calendar.SEPTEMBER);
  try {
      Thread.sleep(2000);
  } catch (InterruptedException e) {
      e.printStackTrace();
  }
  System.out.println(cal.getTime());
  </code></pre>
  
  <p>Let's say the first output is</p>
  
  <pre><code>Mon Feb 18 11:33:07 CET 2013
  </code></pre>
  
  <p>What I want here is to get after 2 seconds a second output</p>
  
  <pre><code>Mon Sep 18 11:33:09 CET 2013 // Month = Sep and Seconds = 09
  </code></pre>
  
  <p>What I get instead is</p>
  
  <pre><code>Mon Sep 18 11:33:07 CET 2013 // Month = Sep, seconds don't change, still 07!!
  </code></pre>
  
  <p>If I add <code>cal = Calendar.getInstance();</code> before the second output, I'll get</p>
  
  <pre><code>Mon Feb 18 11:33:09 CET 2013 // Seconds = 09, month doesn't change, still Feb!!
  </code></pre>
  
  <p>I think there must be an easy and obvious implementation that I cannot find.</p>
  
  <p>UPDATE: I cannot use DateFormat on the embedded system I am working on.</p>