求救: Date转成Timestamp的问题???
代码如下
String time="2004-5-5 3:3";
if(null==time||("").equals(time)){
this.beginPlanRepairTime=null;
}else{
SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd hh:mm");
try{
Date tempTime=dateFormat.parse(time);
this.beginPlanRepairTime = new Timestamp(tempTime.getTime());
System.out.println("!!!!!!!!!!!! "+beginPlanRepairTime);
dateFormat=null;
tempTime=null;
}catch(Exception e){
System.out.println("convert error.......");
e.printStackTrace();
}
}
打印出来的日期为什么是2004-05-05 00:00:00.0??