I want to convert date from Persian calendar to Gregorian Calendar. For this, I use ICU4J library (version 65.1). The problem is that this library gives wrong output for some dates.
Here is my code:
ULocale locale = new ULocale("fa_IR@calendar=persian");
GregorianCalendar gregoriancal = new GregorianCalendar();
Calendar persiancal = Calendar.getInstance(locale);
// year month day
persiancal.set(1398, 11, 16);
gregoriancal.setTime(persiancal.getTime());
String day = gregoriancal.get(Calendar.DATE) + "";
System.out.println(day);
----------------------------------------
output: 6
this date in persian calendar ( 1398/11/16 ) equls to 2020-02-05 Wednesday February in Gregorian Calendar
but it gives me 6 as output ( while it should give 5 )
is there something wrong with my code that results in a wrong output??