I am trying to convert date to string but the year 2018 gets changed to 2019 while conversion.
I tried with different dates, it works. It only fails for December 30 and December 31 2018.
SimpleDateFormat fmt = new SimpleDateFormat("YYYY-MM-dd");
Date date = fmt.parse("2018-12-30");
String date2 = fmt.format(date);
Expected result: 2018-12-30
Actual result: 2019-12-30