/**
* 校验时间
*
* @param text
* @return
*/
public static boolean checkTime(String text)
{
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
try
{
Date date = (Date)formatter.parse(text);
return text.equals(formatter.format(date));
}
catch (Exception e)
{
}
return false;
}
校验日期格式为yyyy-MM-dd
于 2021-06-17 16:41:00 首次发布