Java Timestamp Format formatDateTime(java.sql.Timestamp ts)

Here you can find the source of formatDateTime(java.sql.Timestamp ts)

Description

format Date Time

License

Open Source License

Declaration

public static String formatDateTime(java.sql.Timestamp ts) 

Method Source Code

//package com.java2s;

public class Main {
    public static String formatDateTime(java.sql.Timestamp ts) {
        String temp = String.valueOf(ts);
        if (temp != null && temp != "" && temp != "null")
            temp = temp.substring(0, 16);
        else if (temp == "null")
            temp = "";
        return temp;
    }//from w w w  .  java 2 s .  com
}

Related

  1. formatDate(Timestamp time)
  2. formatDate(Timestamp time, String pattern)
  3. formatDate(Timestamp timestamp)
  4. formatDateHour(Date date)
  5. formatDateTime(Date date)
  6. formatDateTime(long ms)
  7. formatDateTime(String dTime)
  8. formatDateTime(Timestamp t, String pattern)
  9. formatDateTimeStamp(final Date date)