我有这个代码
public class HelloWorld{
public static void main(String []args){
try{
java.util.Date mDate;
java.text.SimpleDateFormat readFormat = new java.text.SimpleDateFormat("yyyy-mm-dd");
mDate = readFormat.parse("2017-02-05");
System.out.println("date: " + mDate.toString());
} catch (java.text.ParseException e1) {
e1.printStackTrace();
}
}
Run Code Online (Sandbox Code Playgroud)
}
我预计输出像2017年2月5日00:02:00 UTC
但我得到输出Jan 05 00:02:00 UTC 2017为什么?我的代码有什么问题?