java.util.Date nowdate=new java.util.Date(); String myString = "2008-09-08"; SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd", Locale.CHINA); Date d = sdf.parse(myString); boolean flag = d.before(nowdate); if(flag) System.out.print("早于今天") else System.out.print("晚于今天")
java 日期怎么比较大小
最新推荐文章于 2024-08-23 12:50:27 发布