Java SQL Date From convertTime(long time)

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

Description

Convert time.

License

Open Source License

Parameter

Parameter Description
time a parameter

Declaration

public static String convertTime(long time) 

Method Source Code


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

import java.sql.Timestamp;
import java.text.SimpleDateFormat;

public class Main {
    /**//from   ww  w.  j  av a  2 s  . c o m
     * Convert time.
     * 
     * @param time
     * @return
     */
    public static String convertTime(long time) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return dateFormat.format(new Timestamp(time));
    }
}

Related

  1. convertDateToTime(Date date, boolean am)
  2. convertDateToTime(final Date date)
  3. convertIntoDuration(Long time)
  4. convertJavaTimeToJavaSql(Object x)
  5. convertNanoToTime(long nanos)
  6. convertTime(String time)
  7. convertTime2String(long time)
  8. convertTime2TS(long time)
  9. convertTimeToHour(long time)