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