title: Displaying the last two digits of the current year in Java
body: <p>How can I display only the last two digits of the current year without using any substring algorithms or any third party libraries?</p>
  
  <p>I have tried the below method and it gave a four-digit year. I want to know whether there are any date formatting options available to get the current year in two-digit format.</p>
  
  <pre><code>Calendar.getInstance().get(Calendar.YEAR);
  </code></pre>