title: How to extract month from a Date variable?
body: <pre><code> dtNextVisit=cal.getTime();
   out.println(dtNextVisit);
  </code></pre>
  
  <p>I am not including all code here. This displays <code>"Sun Jan 17 02:53:40 PST 2016"</code> in result because month is January.
  Now I want to extract and store the month to another variable suppose: </p>
  
  <pre><code>int month=0;
  </code></pre>
  
  <p>it should display <code>1</code>. </p>