DateFormat parse 方法怎么老是出错
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
public class fdate
{
public static void main(String[] args)
{
DateFormat dfat=new SimpleDateFormat("yyyyMMdd");
try
{
Date date=dfat.parse(new Date().toString());
System.out.println(date.toString());
}
catch (Exception e)
{
System.out.println(e);
}
}
}
------解决方案--------------------