Android Date Format formatDate(Date date, String pattern)

Here you can find the source of formatDate(Date date, String pattern)

Description

format Date

Declaration

public static String formatDate(Date date, String pattern) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;
import java.util.Locale;

public class Main {
    public static String formatDate(Date date, String pattern) {
        return formatDate(date, pattern, Locale.getDefault());
    }//from   w  w  w  . j  ava2  s.c o  m

    public static String formatDate(Date date, String pattern, Locale locale) {
        SimpleDateFormat dateFormat = new SimpleDateFormat(pattern, locale);
        return dateFormat.format(date);
    }
}

Related

  1. formatcurrentDate(int format)
  2. formatDataTime(Date date)
  3. formatDate(Date date)
  4. formatDate(Date date)
  5. formatDate(Date date)
  6. formatDate(Date date, String pattern, Locale locale)
  7. format(Date d, String dateFormat)
  8. getShortFriendlyDate(Date dt)
  9. getFormatDateString(String format)