java计算两个字符串日期相隔天数
public static void main(String[] args) throws ParseException {Scanner sc = new Scanner(System.in);System.out.print("请输入计算开始的日期(yyyy-MM-dd):");String startTime = sc.next();System.out.print("请输入计算结束的日期(yyyy-MM-dd):");String endTime = sc.next();long daysBetween = DateUtil.betweenDay(new SimpleDateFormat("yyyy-MM-dd").parse(startTime), new SimpleDateFormat("yyyy-MM-dd").parse(endTime), true);System.out.println("中间间隔日期是:" + daysBetween);}