how do you account for two possible date formats one with milliseconds and one without when parsing date using simpledateformat? [duplicate]
问题 This question already has answers here : How to parse dates in multiple formats using SimpleDateFormat (12 answers) Java LocalDateTime.parse with millisecond precision but optional microsecond precision (1 answer) How to check validity of Date String? (4 answers) Closed 5 months ago . There can be two different date time formats as shown below. The second variant has milliseconds time. 2020-09-07T16:15:42Z 2020-09-09T11:41:58.5152Z Currently i am using this way to parse the date. Is there a