I am trying to parse the String into simple date format but getting unable to parse date exception.could some one try to help me out on this.
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)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…