Java Date to String date2String(String formater, Date aDate)

Here you can find the source of date2String(String formater, Date aDate)

Description

date String

License

Apache License

Declaration

public static String date2String(String formater, Date aDate) 

Method Source Code

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

import java.text.SimpleDateFormat;
import java.util.*;

public class Main {

    public static String date2String(String formater, Date aDate) {
        if (formater == null || "".equals(formater))
            return null;
        if (aDate == null)
            return null;
        return new SimpleDateFormat(formater).format(aDate);
    }//w  w  w .j  a  v  a  2 s  .  com

    public static String date2String(String formater) {
        return date2String(formater, new Date());
    }
}

Related

  1. date2String(Date date, String pattern)
  2. date2String(Date source, String formatString)
  3. date2String(Date value)
  4. date2String(java.util.Date date, String format)
  5. date2String(java.util.Date date, String pattern)
  6. date2String(String pattern, Date date)
  7. date2String2(Date date)
  8. date2StringISO(Date date)
  9. date2StringMD(Date date)