Java SQL Time Create getTime(long time)

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

Description

get Time

License

Open Source License

Declaration

public static String getTime(long time) 

Method Source Code


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

import java.sql.Timestamp;

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

public class Main {

    public static String getTime(long time) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        return format.format(new Date(time));
    }//w ww  .j  a va2s .  co  m

    public static String getTime(Timestamp time) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        return format.format(time);
    }
}

Related

  1. getTime(final int hour, final int minute, final int second)
  2. getTime(GregorianCalendar cal)
  3. getTime(java.util.Date date)
  4. getTime(long time)
  5. getTime(long time)
  6. getTime(long time, boolean allowNull)
  7. getTime(Map map, String attr)
  8. getTime(Object value)
  9. getTime(Object value, int columnType)