public boolean checkTimeFormat(String time) throws Exception {
Format f = new SimpleDateFormat("yyyyMMdd");
Date d = (Date) f.parseObject(time);
String format = f.format(d);
if (time.equals(format)) {
return true;
}else {
return false;
}
}
检验日期格式
最新推荐文章于 2024-07-04 15:52:11 发布