title: How can I convert epoch time to date and time in Java?
body: <p>I need to convert epoch timestamp to date and time.
  I have used the following code to convert but it converts to a wrong date, year and time.</p>
  <pre><code>String date = new SimpleDateFormat(&quot;MM/dd/yyyy HH:mm:ss&quot;)
                      .format(new java.util.Date (1319286637/1000));
  </code></pre>
  <p>Expected output was today’s date at some time, but the result I got was:</p>
  <blockquote>
  <p>01/01/1970 05:51:59</p>
  </blockquote>