공부
Whats the recommended way to validate ISO8601 datetime string in java
승가비
2022. 7. 1. 02:02
728x90
boolean isValidISODateTime(String date) {
try {
java.time.format.DateTimeFormatter.ISO_DATE_TIME.parse(date);
return true;
} catch (java.time.format.DateTimeParseException e) {
return false;
}
}
Whats the recommended way to validate ISO8601 datetime string in java
I am using java 11. Wanted to know whats the best(Most importantly Recommended) way to validate if the datetime string is ISO8601 complaint in java. Also how to compare this string value with java....
stackoverflow.com
728x90