How to get Date object in “YYYY-MM-DD” format in android
<p>I have a requirement that I need to compare two Dates. One Date will come from DB which is String in "YYYY-DD-MM" firm and I need to compare this String Date with current Date.</p>

<p>for this I am converting Date String into Date object.</p>

<p>Now I need current Date also in "YYYY-MM-DD" format and it should be Date object so that I can use.compareTo() method compare two dates..</p>

<p>Please help me how to do that...</p>
