INNER CODE UNIT · Java
solarTermIndex
xkzhangsan/xk-time · src/main/java/com/xkzhangsan/time/LunarDate.java:555
int solarTermIndex = -1;
int tempMonth = month - 1;
int firstSolarTermOfMonth = solarTerm(year, tempMonth*2);
int secondSolarTermOfMonth = solarTerm(year, tempMonth*2+1);
if(day == firstSolarTermOfMonth){
solarTermIndex = tempMonth*2;
}else if(day == secondSolarTermOfMonth){
solarTermIndex = tempMonth*2 + 1;
}
nongDate[7] = solarTermIndex;
return nongDate;
}
/**
* 获取农历中文年
* @param year 年
* @return String
*/