Date dd = sdf.parse(strDate , pp);
                             ---
                             从pp开始解析

解决方案 »

  1.   

    The method attempts to parse text starting at the index given by pos. If parsing succeeds, then the index of pos is updated to the index after the last character used (parsing does not necessarily use all characters up to the end of the string), and the parsed date is returned. The updated pos can be used to indicate the starting point for the next call to this method. If an error occurs, then the index of pos is not changed, the error index of pos is set to the index of the character where the error occurred, and null is returned. 
    大概的意思是用来建立指向String转换为Date()时的索引位置。
    ParsePosition pp = new ParsePosition( 0 );就是从String第0个字符位置开始parse,1的话就是从第一个字符位置开始parse吧
      

  2.   

    谢谢,懂了,用来标明解析开始位,其实也可以不明传pos的,呵呵