Here you can find the source of convertTime(long time)
Parameter | Description |
---|---|
time | a parameter |
public static String convertTime(long time)
//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)); } }