title: how to get the timestamp of previous dates in java?
body: <p>In my shopping cart application, I am storing all the purchase dates in timestamp.</p>
  
  <p>Suppose, I want to get the timestamp of purchase date n days before (n is configurable). How will I get it using java?</p>
  
  <p>example: something like 
   purchasedateBefore5days = currentTimestamp_in_days - 5;
  I am getting current timestamp using </p>
  
  <pre><code>long currentTimestamp = Math.round(System.currentTimeMillis() / 1000);
  </code></pre>
  
  <p>How can i subtract n days from it. I am a beginner. Please help on this.</p>