Java Long Number to Date secToDate(long secs, String format)

Here you can find the source of secToDate(long secs, String format)

Description

sec To Date

License

Apache License

Declaration

public static String secToDate(long secs, String format) 

Method Source Code


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

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

public class Main {
    public static String secToDate(long secs, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(new Date(secs * 1000L));
    }/*from w  ww.j a  v a  2 s  . c om*/
}

Related

  1. getDatebyLong(long dt)
  2. getDateByLongTime(long time)
  3. getDateByMis(long m)
  4. getDateByMisSecond(long misSecond)
  5. minsSecsFromMs(long ms)
  6. toYMDHMSM(long tm)