SimpleDateFormat格式化后,月份出现错误

[code="java"]
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Locale;

public class CommonUtil {
public static Timestamp getDate(){
Timestamp time=new Timestamp(System.currentTimeMillis());
System.out.println("time: "+time);

SimpleDateFormat sdf= new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
String timeStr=sdf.format(time);

System.out.println("timeStr: "+timeStr);
return time;
}
public static void main(String[] args){
System.out.println(getDate());
}
}
[/code]
输出结果:
time: 2013-03-27 22:11:59.244
timeStr: 2013-11-27 10:11:59
2013-03-27 22:11:59.244
这里月份出现错误,是什么原因?

Timestamp time=new Timestamp(System.currentTimeMillis());

System.out.println("time: "+time);

SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

String timeStr=sdf.format(time);

System.out.println("timeStr: "+timeStr);

return time;

mm-MM hh-HH

yyyy-mm-dd hh:mm:ss
改为yyyy-MM-dd HH:mm:ss

没仔细看api么 月份的M是大写的

应该是yyyy-MM-dd HH:mm:ss

SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");

MM是月份,mm是分钟