Java Long Number to Timestamp longToDateTime(long timestamp)

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

Description

long To Date Time

License

Apache License

Declaration

public static String longToDateTime(long timestamp) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String longToDateTime(long timestamp) {
        Date date = new Date(timestamp * 1000);
        DateFormat formatter = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss");
        return formatter.format(date);
    }/*  w w w . jav  a2s.  c o  m*/
}

Related

  1. addSecondsToTimeStamp(Long timestamp, int seconds)
  2. getCompactStringTimestamp(long timestamp)
  3. getIndex(String index, long timestamp)
  4. longToDate(long timestamp)
  5. longToDateTime(long timestamp)
  6. prettyPrintDate(long timestamp)
  7. printTimestamp(Long c)
  8. reverseTimestampToNormalTime(long timestamp)