I am trying to create date time format for optional time part currently I implemented this
import java.time.*;
import java.time.format.DateTimeFormatter;
import j
I think what you want is DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss[.SSS][.S]'Z'")
Basically it's saying to first check for the long-form of 2+ fraction-of-second digits, otherwise if that optional field is not present, check for the optional field of a single fraction-of-second digit specified by [.S]