Java Locale Format formatDate(java.util.Date d, String format)

Here you can find the source of formatDate(java.util.Date d, String format)

Description

format Date

License

Open Source License

Declaration

public static final String formatDate(java.util.Date d, String format) 

Method Source Code

//package com.java2s;

import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.util.Locale;

public class Main {
    public static final String formatDate(java.util.Date d) {
        DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, new Locale("en"));
        return df.format(d);
    }/*  ww w .j  av a  2  s .  c o  m*/

    public static final String formatDate(java.util.Date d, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(d);
    }
}

Related

  1. formatDate(Date value, String pattern, TimeZone tz)
  2. formatDate(final Date dat, final String pattern)
  3. formatDate(final Date date, final String datepattern, TimeZone tz)
  4. formatDate(final Date date, final String format)
  5. formatDate(final Date date, final String pattren)
  6. formatDate(java.util.Date d, String format)
  7. formatDate(java.util.Date date, String formatPattern)
  8. formatDate(String _Date)
  9. formatDate(String dateStr, String format, String toFormat)