一、法定退休年龄是基础判定标准
根据《关于实施渐进式延迟法定退休年龄的决定》(2025年1月1日起施行)9:
-
男性:原退休年龄60岁 → 逐步延迟至63周岁
-
计算方式:2025年起每4个月延迟1个月(例如2025年1月退休年龄为60岁1个月,2026年1月为60岁4个月,依此类推)。
-
-
女性:
-
原退休年龄50周岁 → 逐步延迟至55周岁(每2个月延迟1个月);
-
原退休年龄55周岁(如女干部)→ 逐步延迟至58周岁(每4个月延迟1个月)。
-
代码实现
public static void main(String[] args) {
System.out.println(calculateRetirement(LocalDate.of(1990, 9, 14), 1)); // 男性(未延迟)
System.out.println(calculateRetirement(LocalDate.of(1990, 9, 14), 0)); // 女55退休(延迟)
System.out.println(calculateRetirement(LocalDate.of(1990, 9, 14), 2)); // 女50退休(延迟)
}
public static String calculateRetirement(LocalDate birthday, int sex) {
// 转换为年月(忽略具体日期)
YearMonth birthYM = YearMonth.from(birthday);
// 定义基准参数
int originalAge;
YearMonth benchmark;
int maxDelay;
String genderType;
if (sex == 1) { // 男性
originalAge = 60;
benchmark = YearMonth.of(1964, 12);
maxDelay = 36;
genderType = "男";
} else if (sex == 0) { // 女55岁退休
originalAge = 55;
benchmark = YearMonth.of(1969, 12);
maxDelay = 36;
genderType = "女(55岁退休)";
} else if (sex == 2) { // 女50岁退休
originalAge = 50;
benchmark = YearMonth.of(1974, 12);
maxDelay = 60;
genderType = "女(50岁退休)";
} else {
return "性别参数错误!0=女55岁退休, 1=男, 2=女50岁退休";
}
// 计算原退休年月
YearMonth originalRetireYM = birthYM.plusYears(originalAge);
// 检查是否需要延迟:cite[2]:cite[3]
if (!birthYM.isAfter(benchmark)) {
return String.format("出生日期: %s\n性别类型: %s\n退休年龄: %d岁\n退休年月: %s\n(未延迟退休)",
birthday, genderType, originalAge,
originalRetireYM.format(DateTimeFormatter.ofPattern("yyyy年MM月")));
}
// 计算延迟月数:cite[2]
long monthsDiff = benchmark.until(birthYM, ChronoUnit.MONTHS);
long delayMonths = (long) Math.ceil(monthsDiff / (sex == 2 ? 2.0 : 4.0));
delayMonths = Math.min(delayMonths, maxDelay);
// 计算实际退休年月
YearMonth actualRetireYM = originalRetireYM.plusMonths(delayMonths);
// 计算精确退休年龄
long totalMonths = birthYM.until(actualRetireYM, ChronoUnit.MONTHS);
int years = (int) (totalMonths / 12);
int months = (int) (totalMonths % 12);
return String.format("出生日期: %s\n性别类型: %s\n退休年龄: %d岁%d个月\n退休年月: %s\n延迟月数: %d个月",
birthday, genderType, years, months,
actualRetireYM.format(DateTimeFormatter.ofPattern("yyyy年MM月")),
delayMonths);
}
输出结果
出生日期: 1990-09-14
性别类型: 男
退休年龄: 63岁0个月
退休年月: 2053年09月
延迟月数: 36个月
出生日期: 1990-09-14
性别类型: 女(55岁退休)
退休年龄: 58岁0个月
退休年月: 2048年09月
延迟月数: 36个月
出生日期: 1990-09-14
性别类型: 女(50岁退休)
退休年龄: 55岁0个月
退休年月: 2045年09月
延迟月数: 60个月