Android Date Format formatDate(SimpleDateFormat s, Date d)

Here you can find the source of formatDate(SimpleDateFormat s, Date d)

Description

format Date

Parameter

Parameter Description

Return

: String

Declaration

public static String formatDate(SimpleDateFormat s, Date d) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    /**//  w ww. ja  va  2  s  . c  om
     * @Title : formatDate
     * @param : @param d
     * @return : String
     */
    public static String formatDate(Date d) {
        SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return s.format(d);
    }

    /**
     * @Title : formatDate
     * @param : @param s
     * @param : @param d
     * @return : String
     */
    public static String formatDate(SimpleDateFormat s, Date d) {
        return s.format(d);
    }
}

Related

  1. formatDate(Date date, String pattern)
  2. formatDate(Date date, String pattern)
  3. formatDate(Date date, String pattern)
  4. formatDate(Date date, String pattern, TimeZone zone)
  5. formatDate(Date time)
  6. formatDate(String date)
  7. formatDate(long millis)
  8. formatDate1(String date)
  9. formatDateAndTime(long millis)