How can I parse a string like this using some DateFormat?
Wednesday, 24th July
As far as I can tell there's nothing in SimpleDateFormat
.
try this
String str = "Wednesday, 24th July";
str = str.replaceAll("(\\d\\d)..", "$1") + " " + Calendar.getInstance().get(Calendar.YEAR);
Date date = new SimpleDateFormat("EEEE, dd MMMM yyyy", Locale.US).parse(str);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With