Java Locale Format format(Date date, String parttern)

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

Description

format

License

LGPL

Declaration

public static String format(Date date, String parttern) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.text.SimpleDateFormat;

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

public class Main {
    public static String format(Date date, String parttern) {
        if (date == null) {
            return "";
        }/*from w ww .jav a 2s  . c o  m*/
        if (parttern == null || parttern.equals("")) {
            return "";
        }
        SimpleDateFormat formater = new SimpleDateFormat(parttern, Locale.ENGLISH);
        return formater.format(date);
    }
}

Related

  1. format(Date d, String format)
  2. format(Date date)
  3. format(Date date)
  4. format(Date date, String format)
  5. format(Date date, String format, Locale locale)
  6. format(Date date, String pattern)
  7. format(Date date, String pattern)
  8. format(Date date, String pattern, Locale locale)
  9. format(Date inputDate, String format, Locale locale)