Date  m_endTime  =  new  java.text.SimpleDateFormat(  "yyyy-MM-dd  hh:mm:ss  ").parse(m_strBeginDate);

解决方案 »

  1.   

    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
       {
         //非法日期
       }
      

  2.   

    the above means are all good.if you are using Oracle, then you can use directly TO_DATE function.
      

  3.   

    TO: mercury1231(呵呵,其实我什么都不懂) 
    象月日年这种的行吗
      

  4.   

    TO: mercury1231(呵呵,其实我什么都不懂) 
    象 (月 日,年)这种行不行?
      

  5.   

    first,  are you using Oracle?if you are using Oracle, then there should be no problem using it. I don't know other databases.