Java SQL Date From convertTime2String(long time)

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

Description

convert Time String

License

Open Source License

Parameter

Parameter Description
time a parameter

Declaration

public static String convertTime2String(long time) 

Method Source Code

//package com.java2s;
/*//from   ww w .  ja  v  a2 s.c  o m
 * @(#)ConversionUtil.java
 *
 * Copyright by ObjectFrontier, Inc.,
 * 12225 Broadleaf Lane, Alpharetta, GA 30005, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of ObjectFrontier, Inc. You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of
 * the license agreement you entered into with ObjectFrontier.
 */

import java.sql.Timestamp;

import java.text.SimpleDateFormat;

public class Main {
    protected static SimpleDateFormat borDateFmt = new SimpleDateFormat("dd-MM-yyyy-hh_mm_ss");

    /**
     * 
     * @param time
     * @return
     */
    public static String convertTime2String(long time) {

        return convertTS2String(new Timestamp(time));
    }

    /**
     * This method is used to Convert Timestamp 
     * to UserDefined Format
     * @param timeStamp
     * @return String
     */
    public static String convertTS2String(Timestamp timeStamp) {

        return borDateFmt.format(timeStamp);
    }
}

Related

  1. convertIntoDuration(Long time)
  2. convertJavaTimeToJavaSql(Object x)
  3. convertNanoToTime(long nanos)
  4. convertTime(long time)
  5. convertTime(String time)
  6. convertTime2TS(long time)
  7. convertTimeToHour(long time)
  8. convertToDateTime(java.util.Date date, String time)
  9. convertToTime(Date toDate)