wangrong
2026-08-30 4c949c0dc9bcae785c281c9d8125295f09810b15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package io.dataease.utils;
 
import org.apache.commons.lang3.ObjectUtils;
 
import java.util.Calendar;
 
public class CalendarUtils {
 
    public static Long getTimeAfterMonth(Long time, int months) {
        if (ObjectUtils.isEmpty(time)) time = System.currentTimeMillis();
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(time);
        calendar.add(Calendar.MONTH, months);
        return calendar.getTimeInMillis();
    }
}