ADDITIONAL SYSTEM INFORMATION :
Windows 10
A DESCRIPTION OF THE PROBLEM :
When I am trying to get time with TimeZone.getTimeZone("GMT+5:30") and formatting it with SimpleDateFormat.setTimeZone for new Date(), it is returning 2019 year.
TimeZone.getTimeZone(GMT+5:30) = sun.util.calendar.ZoneInfo[id="GMT+05:30",offset=19800000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
dt = Mon Dec 31 15:09:24 IST 2018
rdate2 = 31/12/2019 At 15:09:24
REGRESSION : Last worked in version 8u172
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
SimpleDateFormat dtFormatDate1 =new SimpleDateFormat("dd/MM/YYYY");
SimpleDateFormat dtFormatTime1 =new SimpleDateFormat("HH:mm:ss");
dtFormatDate1.setTimeZone(TimeZone.getTimeZone("GMT+5:30"));
dtFormatTime1.setTimeZone(TimeZone.getTimeZone("GMT+5:30"));
String rdate2 = dtFormatDate1.format(dt)+" At "+ dtFormatTime1.format(dt);
System.out.println("rdate2 = "+rdate2);
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
rdate2 = 31/12/2018 At 15:09:24
ACTUAL -
rdate2 = 31/12/2019 At 15:09:24
FREQUENCY : rarely
Windows 10
A DESCRIPTION OF THE PROBLEM :
When I am trying to get time with TimeZone.getTimeZone("GMT+5:30") and formatting it with SimpleDateFormat.setTimeZone for new Date(), it is returning 2019 year.
TimeZone.getTimeZone(GMT+5:30) = sun.util.calendar.ZoneInfo[id="GMT+05:30",offset=19800000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
dt = Mon Dec 31 15:09:24 IST 2018
rdate2 = 31/12/2019 At 15:09:24
REGRESSION : Last worked in version 8u172
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
SimpleDateFormat dtFormatDate1 =new SimpleDateFormat("dd/MM/YYYY");
SimpleDateFormat dtFormatTime1 =new SimpleDateFormat("HH:mm:ss");
dtFormatDate1.setTimeZone(TimeZone.getTimeZone("GMT+5:30"));
dtFormatTime1.setTimeZone(TimeZone.getTimeZone("GMT+5:30"));
String rdate2 = dtFormatDate1.format(dt)+" At "+ dtFormatTime1.format(dt);
System.out.println("rdate2 = "+rdate2);
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
rdate2 = 31/12/2018 At 15:09:24
ACTUAL -
rdate2 = 31/12/2019 At 15:09:24
FREQUENCY : rarely