-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
8u221
-
x86_64
-
windows_7
A DESCRIPTION OF THE PROBLEM :
execute the following:
Calendar rightNow= Calendar.getInstance();
rightNow.get(Calendar.MONTH);
The get(Calendar.MONTH) method returns the previous month of the given date instead of the current month. If you execute this on Sept 19 2019, it will return august as the month.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
execute the following:
Calendar rightNow= Calendar.getInstance();
rightNow.get(Calendar.MONTH);
The get(Calendar.MONTH) method returns the previous month of the given date instead of the current month. If you execute this on Sept 19 2019, it will return august as the month.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Return the month of the date being passed instead of the previous month
ACTUAL -
Returns the previous month of the given date passed
---------- BEGIN SOURCE ----------
execute the following:
Calendar rightNow= Calendar.getInstance();
rightNow.get(Calendar.MONTH);
The get(Calendar.MONTH) method returns the previous month of the given date instead of the current month. If you execute this on Sept 19 2019, it will return august as the month.
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
add +1 to the result returned
FREQUENCY : always
execute the following:
Calendar rightNow= Calendar.getInstance();
rightNow.get(Calendar.MONTH);
The get(Calendar.MONTH) method returns the previous month of the given date instead of the current month. If you execute this on Sept 19 2019, it will return august as the month.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
execute the following:
Calendar rightNow= Calendar.getInstance();
rightNow.get(Calendar.MONTH);
The get(Calendar.MONTH) method returns the previous month of the given date instead of the current month. If you execute this on Sept 19 2019, it will return august as the month.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Return the month of the date being passed instead of the previous month
ACTUAL -
Returns the previous month of the given date passed
---------- BEGIN SOURCE ----------
execute the following:
Calendar rightNow= Calendar.getInstance();
rightNow.get(Calendar.MONTH);
The get(Calendar.MONTH) method returns the previous month of the given date instead of the current month. If you execute this on Sept 19 2019, it will return august as the month.
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
add +1 to the result returned
FREQUENCY : always