本文为博主原创,未经允许不得转载: java计算两个年月日之间相差的天数: public static int daysBetween(String smdate,String bdate) throws ParseException{ int daysInterval=0; if(StringUtils.isNoneBlank(smdate)&&StringUtils.isNoneBlank(bdate)){ SimpleDateForm
java.util.Date 包含有年月日时分秒,精确到毫秒级别. 官方解释: // The class Date represents a specific instant in time, with millisecond precision. // 语句 Date date = new Date(); System.out.println(date); //输出结果 Sat Feb 03 14:48:47 CST 2018 java.sql.Date 包含年月日,时分秒都被设置为0,之所以