Android Date Format ParseDateToString(Date date, String format)

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

Description

Parse Date To String

Declaration

public static String ParseDateToString(Date date, String format) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static String ParseDateToString(Date date) {
        return ParseDateToString(date, "yyyy-MM-dd HH:mm:ss");
    }//from w ww. ja v a  2s  . c  o  m

    public static String ParseDateToString(Date date, String format) {
        SimpleDateFormat dateFormat = new SimpleDateFormat(format);

        return dateFormat.format(date);
    }
}

Related

  1. FormatToString(Date date, String format)
  2. FormatToString(String date, String format)
  3. ParseDateToString(Date date)
  4. date(Date date)
  5. format(Date date)
  6. format(Date date, String format)
  7. format(Date date, boolean isDateOnly)