可以试试下面的代码:SimpleDateFormat formatter = new SimpleDateFormat ("yyyy.MM.dd");
//假定像2002.07.04的是合法日期其他都非法。
String str="2002.07.04";
ParsePosition pos = new ParsePosition(0);
Date dt=formatter.parse(str,pos);
if(dt!=null)
{
//是合法日期
}
else
{
//非法日期
}
//假定像2002.07.04的是合法日期其他都非法。
String str="2002.07.04";
ParsePosition pos = new ParsePosition(0);
Date dt=formatter.parse(str,pos);
if(dt!=null)
{
//是合法日期
}
else
{
//非法日期
}
你的EMAIL。。
thanks
分一定给!
[email protected]
能给我吗?