Java Long Number to Timestamp unixTimestampToDate(long timestamp)

Here you can find the source of unixTimestampToDate(long timestamp)

Description

unix Timestamp To Date

License

Open Source License

Declaration

public static String unixTimestampToDate(long timestamp) 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class Main {
    public static final String DATE_FULL_STR = "yyyy-MM-dd HH:mm:ss";

    public static String unixTimestampToDate(long timestamp) {
        SimpleDateFormat sd = new SimpleDateFormat(DATE_FULL_STR);
        sd.setTimeZone(TimeZone.getTimeZone("GMT+8"));
        return sd.format(new Date(timestamp));
    }/*from   w w  w.j  a va2  s.  c  o  m*/
}

Related

  1. timestampToString(long time)
  2. timestampToString(long timestamp)
  3. timeString(long timestamp)
  4. toDateTimeString(long timestamp)
  5. toSolrTimestamp(Long epoch)
  6. unixToDate(final long timestamp)