SimpleDateFormat

Posted by manu on Stack Overflow See other posts from Stack Overflow or by manu
Published on 2010-06-16T19:54:13Z Indexed on 2010/06/16 20:02 UTC
Read the original article Hit count: 263

Filed under:
|

Hi,
The following code is giving me the parsed date as "Wed Jan 13 00:00:00 EST 2010" instead of "Wed Jun 13 00:00:00 EST 2010". Any ideas much appreciated.

    SimpleDateFormat sf = new SimpleDateFormat("yyyy-mm-dd'T'HH:mm:ss");

    String str = "2010-06-13T00:00:00";

    Date date = sf.parse(str);

    System.out.println(" Date " + date.toString());

© Stack Overflow or respective owner

Related posts about java

Related posts about simpledateformat