java SimpleDateFormat
在Java中,如何解析包含不代表模式的字母的日期字符串?
"2007-11-02T14:46:03+01:00"
String date ="2007-11-02T14:46:03+01:00"; String format = "yyyy-MM-ddTHH:mm:ssz"; new SimpleDateFormat(format).parse(date); Exception in thread "main" java.lang.IllegalArgumentException: Illegal pattern character 'T' at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:769) at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:576) at java.text.SimpleDateFormat.(SimpleDateFormat.java:501) at java.text.SimpleDateFormat.(SimpleDateFormat.java:476)