I am having problem with this small piece of code
SimpleDateFormat sf = new SimpleDateFormat(\"yyyy-mm-dd HH:mm:ss\"); String str = \"2010-03-13 01:01:22\";
mm stands for minute. You should use MM when parsing month:
mm
MM
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
You are using minute instead of month in your pattern. It should be:
yyyy-MM-dd HH:mm:ss