title: Java TIMESTAMP has trailing zeros, how do I remove?
body: <p>I'm using Java with hibernate and am in the early stages of learning how everything works. I'm getting there slowly but I have had some trouble with dates in Java.</p>
  
  <p>My current problem is that when I get a timestamp from a MySQL database it seems to have a load of extra zeros on the end. When I pass this through to PHP (yes its a Java/PHP application we're writing) then formatting the date ends with an incorrect result.</p>
  
  <p>Here's what I see:</p>
  
  <pre><code>2000-08-10 14:09:21 // Time in database
  965912961000 // Timestamp from Java of this time
  965912961 // The PHP equivalent of the database timestamp - using strtotime()
  </code></pre>
  
  <p>In the Java model I have the variable setup like this:</p>
  
  <pre><code>@Temporal (TemporalType.TIMESTAMP)
  private Date logTime
  </code></pre>
  
  <p>So my question is how do I get rid of the three trailing zeros? Obviously I could remove these with PHP but I'd rather it came from the back-end Java if possible.</p>