pcs 支路
This commit is contained in:
@ -8,6 +8,7 @@ import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
|
||||
@ -188,4 +189,15 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
|
||||
return Date.from(zdt.toInstant());
|
||||
}
|
||||
|
||||
public static Long getNowMonthLong() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
long month = (long) calendar.get(Calendar.MONTH) + 1; // 月份从0开始,所以要加1
|
||||
return month;
|
||||
}
|
||||
public static Long getNowDayLong() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
long date = calendar.get(Calendar.DAY_OF_MONTH); // 月份从0开始,所以要加1
|
||||
return date;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user