Java Time Format long2Datestr(long time, String format)

Here you can find the source of long2Datestr(long time, String format)

Description

long Datestr

License

Open Source License

Declaration

public static String long2Datestr(long time, String format) 

Method Source Code

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

import java.text.SimpleDateFormat;

public class Main {
    public static String long2Datestr(long time, String format) {
        if (format == null || format.trim().equals(""))
            format = "yyyy-MM-dd HH:mm:ss";

        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(time);
    }/*  w  w w  .j  a  v  a2s  .  c  o  m*/
}

Related

  1. getTwoTimeInterval(String startTime, String endTime, String format)
  2. getUniversalDateTimeFormat()
  3. getXsdDateTimeFormat()
  4. getXSDFormatter(DateTime date)
  5. isDateFormat(String timeString)
  6. long2String(long longTime, String dataFormat)
  7. long2String(long longTime, String dataFormat)
  8. newDateTimeFormat()
  9. printDate(final long time, final String dateFormat)