Java SQL Time Create getTime(long time)

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

Description

Creates a timestamp using the Timestamp class.

License

Open Source License

Parameter

Parameter Description
time The time in milliseconds.

Return

The time in military format with seconds.

Declaration

public static String getTime(long time) 

Method Source Code

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

import java.sql.Timestamp;

public class Main {
    /**/*from www. j a  v a 2  s  . co  m*/
     * Creates a timestamp using the Timestamp class.
     * 
     * @param time
     *            The time in milliseconds.
     * @return The time in military format with seconds.
     */
    public static String getTime(long time) {
        String stamp = new Timestamp(time).toString();

        return stamp.substring(0, stamp.length() - 4);
    }
}

Related

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