I have a string, is there a simple way to validate whether the string represents ISO 8601 week number in java?
String s="2012-W43-5"
This one represents 5 th day in 43 rd week in 2012.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just check if
SimpleDateFormat#parse()doesn’t throw aParseException.Note that the
setLenient(false)makes it non-lenient which thus means that overflowed values won’t roll over.