String to date with no format specified
<p>I want to convert a string into a date, this is simple. But what I'd like to do it without knowing the date format.</p>

<p>Here is a situation: say I have 100 dates and all are in the same format but I'd like to write a Java program to find out this format for me. The result of this program should give me a list of all the possible formats.</p>

<p>For example:</p>

<pre><code> 06-06-2006
 06-06-2009

 ...

 06-13-2001 &lt;- 99th record 
</code></pre>

<p>the result of this will give me date format can be <code>mm-dd-yyyy</code></p>

<p>If the 99<sup>th</sup> record also was <code>06-06-2006</code> the result should be <code>mm-dd-yyyy</code> and <code>dd-mm-yyyy</code>.</p>

<p>Can someone please help me with an example?</p>
