adopted date parser due to changes in EASEE API (#13654)

Signed-off-by: Alexander Friese <af944580@googlemail.com>
This commit is contained in:
alexf2015 2022-11-04 19:56:30 +01:00 committed by GitHub
parent 1e07d1af03
commit f880ca91f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,7 +56,12 @@ public final class Utils {
* @return
*/
public static ZonedDateTime parseDate(String date) throws DateTimeParseException {
final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssX");
DateTimeFormatter formatter;
if (date.length() == 24) {
formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSX");
} else {
formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssX");
}
LOGGER.trace("parsing: {}", date);
ZonedDateTime zdt = ZonedDateTime.parse(date, formatter);
return zdt;