Java Date to String date2Str(Date date)

Here you can find the source of date2Str(Date date)

Description

date Str

License

Apache License

Declaration

public static String date2Str(Date date) 

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 date2Str(Date date) {
        String format = "yyyy-MM-dd HH:mm:ss";
        return date2Str(date, format);
    }/* ww  w . j a v  a2s. c  om*/

    public static String date2Str(Date date, String format) {
        SimpleDateFormat df = new SimpleDateFormat(format);
        return df.format(date);
    }
}

Related

  1. date2str(Calendar c)
  2. date2Str(Calendar c, String format)
  3. date2Str(Date aDate)
  4. Date2Str(Date date)
  5. date2Str(Date date)
  6. date2Str(Date date, String dateFormat)
  7. date2Str(Date date, String format)
  8. date2Str(Date date, String format)
  9. date2Str(Date date, String partten)