Java Date Long Format getLongDisplayTime(long time)

Here you can find the source of getLongDisplayTime(long time)

Description

get Long Display Time

License

Open Source License

Declaration

public static String getLongDisplayTime(long time) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Main {

    public static String getLongDisplayTime(long time) {
        Calendar cd = Calendar.getInstance();
        cd.setTimeInMillis(time);/*w  w w . ja  v a  2  s  .  c  o m*/
        Date date = cd.getTime();

        if (date == null) {
            return null;
        }
        DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return dateformat.format(date);
    }
}

Related

  1. getLongDateString(Date date)
  2. getLongDateString(Date date)
  3. getLongDateString(Date date)
  4. getLongDateString(Date date, boolean includeTime)
  5. getLongDisplayDate(Date moment, TimeZone tz, Locale inLocale)
  6. getLongFormatTime(java.util.Date date)
  7. getLongFromDatestamp(String datestamp)
  8. getLongGmtDateString(Date date)
  9. getLongMillis(String date)