public static void main(String[] args) { Date d1 = null; try { d1 = DateFormatUtil.StringToDate("2018-02-18 9:22:22"); } catch (ParseException e) { e.printStackTrace(); } Date d = new Date(); System.out.println(d1); System.out.println(d); //String date = d.toString(); System.out.println(d1.getTime()); System.out.println(d.getTime()); System.out.println(Math.abs(d.getTime()-d1.getTime()) > 24*60*60*1000*90);}
原文地址:https://www.cnblogs.com/fan3516/p/10394028.html
时间: 2024-11-05 00:42:01