Java Timestamp Field getDateTime(Timestamp argRenDt)

Here you can find the source of getDateTime(Timestamp argRenDt)

Description

This method converts timestamp to the specified datetime format

License

Open Source License

Parameter

Parameter Description
argRenDt a parameter

Declaration

public static String getDateTime(Timestamp argRenDt) 

Method Source Code

//package com.java2s;

import java.sql.Timestamp;

import java.text.SimpleDateFormat;

public class Main {
    /**/*  w w  w. j  a  v  a  2 s.  c  o m*/
     * This method converts timestamp to the specified datetime format
     * 
     * @param argRenDt
     * @return
     */
    public static String getDateTime(Timestamp argRenDt) {

        String strDate = null;
        if (argRenDt != null) {
            SimpleDateFormat dtFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
            strDate = dtFormat.format(argRenDt);
        }
        return strDate;

    }
}

Related

  1. getDateString(java.sql.Timestamp ts)
  2. getDateString(Timestamp time, String pattern)
  3. getDateTime(Timestamp timestamp)
  4. getDateTimeFromSqlTimestamp(Timestamp timestamp)
  5. getDateTimeFromTimeStamp(Timestamp timestamp)
  6. getDateTimestamp(ResultSet rs, String columnLabel)