Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
long timethis = calendar.getTimeInMillis();
calendar.setTime(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse("2008-11-1 03:56:27"));
long timeend = calendar.getTimeInMillis();
long theday = (timethis - timeend) / (1000 * 60 * 60 * 24);
System.out.print(theday);
java日期间隔
最新推荐文章于 2021-02-26 02:13:00 发布