我正在尝试设置日期格式,但是当我运行此代码时
String oldstring = "2013-01-1";
System.out.println("oldstring = "+oldstring);
Date date = new SimpleDateFormat("yyyy-mm-dd").parse(oldstring);
System.out.println("datefield = "+date);
我拿结果:
oldstring = 2013-01-1
datefield = Tue Jan 01 00:01:00 MSK 2013
为什么日期字段不等于 2013-01-1?