Java Date Format convertDateToString(Date date, String patternString, Locale locale)

Here you can find the source of convertDateToString(Date date, String patternString, Locale locale)

Description

convert Date To String

License

Apache License

Declaration

public static String convertDateToString(Date date, String patternString, Locale locale) 

Method Source Code


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

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.Locale;

public class Main {
    public static String convertDateToString(Date date, String patternString) {
        return convertDateToString(date, patternString, Locale.getDefault());
    }/* w  w  w  . j a va2  s. c o  m*/

    public static String convertDateToString(Date date, String patternString, Locale locale) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(patternString, locale);
        return simpleDateFormat.format(date);
    }
}

Related

  1. convertDateToString(Date date, int addHours)
  2. convertDateToString(Date date, String dateFormat)
  3. convertDateToString(Date date, String format)
  4. convertDateToString(Date date, String pattern)
  5. convertDateToString(Date date, String pattern)
  6. convertDateToString(Date dateObject, String dateFormat)
  7. convertDateToStringByFormat(Date date)
  8. convertDateToStringT(final Date date)
  9. convertDateToStringUI(Date data)