Category "simpledateformat"

How to formate or validate date in java like 20992012 or 12122022? [duplicate]

i have to validate date yyyyMMdd or MMddyyyy or ddMMyyyy. if i pass input 20221224, ho to make this is valid? but how can i do this in regex

java use simpledateformat to parse a input String get ParseException, and just because of a space

I input a string likes the SimpleDateFormat pattern asked, but it will be ParseException. I do several tests. If I change space between "dd HH" to "dd-HH", the