title: Unable subtract days from date in java
body: <p>I want to subtract days from date in java. But I <strong>dont want to use external libraries</strong>. I have referred some of questions from stackoverflow but they are suggesting to use external libraries. So I have applied following logic</p>
  
  <pre><code>noOfDays = 24;
  Date compareDate = new Date(currentDate - noOfDays * 24 * 60 * 60 * 1000);
  System.out.println("compare date " + compareDate);
  </code></pre>
  
  <p>It is working fine till 24 days.But after 24 days it is giving unexpected result. Is there any solution to this ?</p>