博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
判断是否为时间格式
阅读量:7261 次
发布时间:2019-06-29

本文共 325 字,大约阅读时间需要 1 分钟。

public static boolean isValidDate(String str) {     DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");     try{         Date date = (Date)formatter.parse(str);         return str.equals(formatter.format(date));     }catch(Exception e){         return false;     }}

 

转载于:https://www.cnblogs.com/sunBinary/p/9971088.html

你可能感兴趣的文章