title: Epoch time in Java
body: <p>I would like to represent 1 day from current date as epoch time. Today's date is Oct 20th. So I would like to get the epoch time for tomorrow. I have the below code -</p>
  
  <pre><code>    Calendar cal = Calendar.getInstance();
      cal.setTime(new Date());
      cal.add(Calendar.DAY_OF_YEAR, 1);
      int time = (int) ((cal.getTimeInMillis())/1000);
      System.out.println("TIME IS: " +time);
  </code></pre>
  
  <p>So I basically want to add 1 day to current day of the year i.e. Oct 20th, and represent that as epoch time. I am displaying the time in seconds, hence the divide by 1000. The result for the program is 1413958770. 1 day from today would be 86400 seconds. How exactly does epoch time work? I understand it gives time since 1970, but if that is indeed the case, the value can't be that small :-). Am I missing something here?</p>