title: Getting current time in seconds and saving it in integer
body: <p>In Android,  I am getting the current time in milli seconds as follows:</p>
  
  <pre><code>long currentDateMS = new Date().getTime();
  </code></pre>
  
  <p>and the value is right when I print the time.  But I need the time in seconds and save the time as an integer.  I am converting it into seconds as below </p>
  
  <pre><code>int seconds = (int) (currentDateMS / 1000);
  </code></pre>
  
  <p>but then it shows the wrong time. I think there is an overflow while converting but I do not know how to solve it.</p>
  
  <p>I need to convert it into 4 bytes of time data</p>