Java Date Format convertDateToString(Date date, String format)

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

Description

convert Date To String

License

Apache License

Declaration

public static String convertDateToString(Date date, String format) 

Method Source Code


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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static String convertDateToString(Date date, String format) {
        SimpleDateFormat df = new SimpleDateFormat(format);
        return df.format(date);
    }/* w w w. ja  va 2  s  . c  o  m*/
}

Related

  1. convertDateToString(Date date)
  2. convertDateToString(Date date)
  3. convertDateToString(Date date, boolean millis)
  4. convertDateToString(Date date, int addHours)
  5. convertDateToString(Date date, String dateFormat)
  6. convertDateToString(Date date, String pattern)
  7. convertDateToString(Date date, String pattern)
  8. convertDateToString(Date date, String patternString, Locale locale)
  9. convertDateToString(Date dateObject, String dateFormat)