How to convert String to Date without knowing the format?

You cant!

If you have the date 2010-08-05 then it can be either 5th August 2010, or 8th May 2010 – you need to know the date format (or at least prioritise one format over the over) to tell them apart.

Leave a Comment