您可以在 Java 中使用JalCal即 Jalali(Persian) 日历转换器:
<dependency>
<groupId>com.github.sbahmani</groupId>
<artifactId>jalcal</artifactId>
<version>1.0</version>
</dependency>
1. Jalali 到 Gregorian
Calendar expected4 = Calendar.getInstance(TimeZone.getDefault());
expected4.set(2014, 7, 5, 1, 23, 1);
assertThat(JalCal.jalaliToGregorian(1393, 5, 14, 1, 23, 1).toString()).isEqualTo(expected4.getTime().toString());
2. 公历到贾拉里
Calendar cal = Calendar.getInstance();
cal.set(Calendar.DAY_OF_MONTH, 5);
cal.set(Calendar.MONTH, 6);
cal.set(Calendar.YEAR, 2014);
cal.set(Calendar.HOUR_OF_DAY, 10);
cal.set(Calendar.MINUTE, 25);
cal.set(Calendar.SECOND, 1);
cal.set(Calendar.MILLISECOND, 0);
assertThat(JalCal.gregorianToJalali(cal.getTime(), true)).isEqualTo("14/04/1393 10:25:01");
assertThat(JalCal.gregorianToJalali(new Date(1426883400000l), true)).isEqualTo("01/01/1394 00:00:00");