System.out.println(Times.format("MMMM dd, yyyy 'at' h:ma", Times.D("2017-11-30 14:41")));
String timeStr = "November 30, 2017 at 2:41pm";
System.out.println(Times.parseq("MMMM dd, yyyy 'at' h:ma",timeStr));
上面打印的数据是
November 30, 2017 at 2:41PM
为啥还原的时候会
Exception in thread "main" java.lang.RuntimeException: java.text.ParseException: Unparseable date: "November 30, 2017 at 2:41pm"
at org.nutz.lang.Lang.wrapThrow(Lang.java:185)
at org.nutz.lang.Times.parseq(Times.java:979)
at com.rekoe.TimeTest.main(TimeTest.java:13)
Caused by: java.text.ParseException: Unparseable date: "November 30, 2017 at 2:41pm"
at java.text.DateFormat.parse(DateFormat.java:366)
at org.nutz.lang.Times.parse(Times.java:1006)
at org.nutz.lang.Times.parseq(Times.java:976)
... 1 more
路过的看看 谢谢