Java Timestamp Format formatDate(Timestamp timestamp)

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

Description

format Date

License

Open Source License

Declaration

public static String formatDate(Timestamp timestamp) 

Method Source Code


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

import java.sql.Timestamp;

import java.text.SimpleDateFormat;

public class Main {
    public static final String DATE_PATTERN = "yyyy-MM-dd";

    public static String formatDate(Timestamp timestamp) {
        SimpleDateFormat sdf = new SimpleDateFormat(DATE_PATTERN);
        return sdf.format(timestamp);
    }//from   ww  w  .  ja  v a  2 s  . c  om
}

Related

  1. formatDate(java.util.Date d)
  2. formatDate(java.util.Date date)
  3. formatDate(Timestamp date)
  4. formatDate(Timestamp time)
  5. formatDate(Timestamp time, String pattern)
  6. formatDateHour(Date date)
  7. formatDateTime(Date date)
  8. formatDateTime(java.sql.Timestamp ts)
  9. formatDateTime(long ms)