title: Getting "unixtime" in Java
body: <p>Date.getTime() returns milliseconds since Jan 1, 1970. Unixtime is seconds since Jan 1, 1970. I don't usually code in java, but I'm working on some bug fixes. I have:</p>
  
  <pre><code>Date now = new Date();      
  Long longTime = new Long(now.getTime()/1000);
  return longTime.intValue();
  </code></pre>
  
  <p>Is there a better way to get unixtime in java?</p>