我正在尝试将字符串解析为简单的日期格式,但无法解析日期异常。有人可以尝试帮助我解决这个问题吗?
String dateFormatter ="20190911T14:37:08.7770400";
SimpleDateFormat sdf = new SimpleDateFormat("YYYYMMDD'T'HH:mm:ss.SSSZZZZ");
//tried the below commnet also
//SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-d'T'HH:mm:ss.SSSZZZZ");
System.out.println(sdf.parse(dateFormatter));
Error:
"Exception in thread "main" java.text.ParseException: Unparseable
date: "20190911T14:37:08.7770400" at
java.text.DateFormat.parse(DateFormat.java:366) at
com.sudha.test.sample_boot_example.TestString.main(TestString.java:20)
陪伴而非守候
茅侃侃
ITMISS
相关分类