以下是将阿拉伯语/伊斯兰/ Hijri日期转换为英语/格鲁吉亚日期的地雷代码 任何人都可以指导我如何逆转它?
public String ArabicToEnglish(String date){
String [] sepratedString = ParseString(date);
int day = Integer.parseInt(sepratedString[0]);
int month = Integer.parseInt(sepratedString[1]);
int year = Integer.parseInt(sepratedString[2]);
double temp = (year-1)+(month-1)/12+(day-1)/354.3;
temp*= 354.3/365.24;
temp+=622.54;
//find year
year = (int) temp;
temp = temp-year;
//find month
temp *= 12;
double temp2 = temp;
month = (int) temp;
temp = temp - month;
for(;;){
if(temp2>temp2-month){
month++;
}else{
break;
}
}
temp *= 30.4167;
day = (int) temp;
return String.valueOf(day)+"-"+String.valueOf(month)+"-"+String.valueOf(year);
}
我使用此资源获取帮助:Link