How to compare two date strings
<p>I have two strings, the first one contains an actual date, and the second one contains a date format.</p>

<p>I want to compare both the strings. Here is my code:</p>

<pre><code>String s1 = "01/02/2012";
String s2 = "dd/MM/yyyy";
if (s1.equalsIgnoreCase(s2)){
   System.out.println("true");}
else {
   System.out.println("false");}
</code></pre>

<p>I have tried with all the string methods (like compare(), equalTo(), etc.). It's always executing the <code>else</code> part, i.e. the condition is always "false".</p>
