Java Date Format convertDateToString(Date date)

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

Description

Concert a date from a dto, to a String.

License

Open Source License

Parameter

Parameter Description
date The date to be converted

Return

A stringed representation of the date.

Declaration

public static String convertDateToString(Date date) 

Method Source Code


//package com.java2s;

import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**//from w  w w .ja v  a2s. c  om
     * Concert a date from a dto, to a String. 
     * @param date   The date to be converted
     * @return A stringed representation of the date.
     */
    public static String convertDateToString(Date date) {

        String stringDate = null;
        if (date != null) {
            DateFormat df = DateFormat.getInstance();
            SimpleDateFormat sf = (SimpleDateFormat) df;
            sf.applyPattern("dd/MM/yyyy");
            stringDate = sf.format(date);
        }
        return stringDate;
    }
}

Related

  1. convertDateToRpcFormat(Date date)
  2. convertDateToString(Date aDate)
  3. convertDateToString(Date aDate)
  4. convertDateToString(Date date)
  5. convertDateToString(Date date)
  6. convertDateToString(Date date)
  7. convertDateToString(Date date)
  8. convertDateToString(Date date)
  9. convertDateToString(Date date, boolean millis)