title: Subtracting dates and get difference in days.How to subtract them?
body: <p>can anyone tell how to subtract string "after" from "today" to get days difference.</p>
  
  <pre><code>import java.text.*;
  import java.util.*;
  
  
  public class Main {
  public static void main(String args[]){
  
  
  SimpleDateFormat sdf=new SimpleDateFormat("yyyy/MM/dd");
  Calendar cal=Calendar.getInstance();
  String today=sdf.format(cal.getTime());
  System.out.println(today);
  cal.add(Calendar.DATE, 20);
  String After=sdf.format(cal.getTime());
  System.out.println(After);
  
  }
  }
  </code></pre>