Java Timestamp getTimeString(Timestamp timestamp)

Here you can find the source of getTimeString(Timestamp timestamp)

Description

get Time String

License

Open Source License

Declaration

public static String getTimeString(Timestamp timestamp) 

Method Source Code

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

import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

public class Main {
    public static String getTimeString(Timestamp timestamp) {
        DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {/*from  ww  w  . jav  a  2s  . com*/
            String str = sdf.format(timestamp);
            return str;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}

Related

  1. getTimeNextDay(Timestamp date)
  2. getTimeNextMonthFirstSec(Timestamp sysDate)
  3. getTimePassedSince(Timestamp timestamp)
  4. getTimeStr(Timestamp tsp)
  5. getTimeString(java.sql.Timestamp ts)
  6. getTodayTimestamp()
  7. getUtilDate(java.sql.Timestamp time)
  8. getValue(Timestamp t)
  9. getZonedDateTime(final Timestamp timestamp)