Java Locale Format format(Date d, String format)

Here you can find the source of format(Date d, String format)

Description

format

License

Open Source License

Declaration

public static String format(Date d, String format) 

Method Source Code


//package com.java2s;

import java.text.DateFormat;

import java.text.SimpleDateFormat;

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

public class Main {
    public static String format(Date d, String format) {
        return format(d, format, Locale.getDefault());
    }/*from   w  w w . j av  a 2s.co  m*/

    public static String format(Date d, String format, Locale locale) {
        if (d == null)
            return "";
        DateFormat df = new SimpleDateFormat(format, locale);
        return df.format(d);
    }
}

Related

  1. format(BigInteger amount)
  2. format(Date d, Locale locale)
  3. format(Date date)
  4. format(Date date)
  5. format(Date date, String format)
  6. format(Date date, String format, Locale locale)