package com.swift.ksv5; import java.util.Date; import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUtil; public class APP2 { public static void main(String[] args) { String dateStr1 = "2023-03-01";//上次跟进时间 Date date1 = DateUtil.parse(dateStr1,"yyyy-MM-dd"); String dateStr2 = "2023-04-06";//当前系统时间 Date date2 = DateUtil.parse(dateStr2,"yyyy-MM-dd"); //相差间隔时长天数 long betweenDay = DateUtil.between(date1, date2, DateUnit.DAY); int standard=10;//标准时长10天 if(betweenDay > standard) { System.out.println("回收客户"); } } }
标签:DateUtil,JAVA,String,parse,Date,日期,大小,import,cn From: https://www.cnblogs.com/hua900822/p/17430247.html