티스토리 뷰

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;
    }
}

https://stackoverflow.com/questions/64861831/whats-the-recommended-way-to-validate-iso8601-datetime-string-in-java

 

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
댓글