Java Date Format convertDateToText(Date date)

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

Description

Convert custom field value to text form

License

Open Source License

Parameter

Parameter Description
date the date which will be converted to string form

Return

string representation of date value

Declaration

public static String convertDateToText(Date date) 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**// w  w  w .j a va 2s .c o m
     * Convert custom field value to text form
     * @param date the date which will be converted to string form
     * @return string representation of date value
     */
    public static String convertDateToText(Date date) {
        if (date != null) {
            SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
            return formatter.format(date);
        }
        return null;
    }
}

Related

  1. convertDateToString(Date date, String patternString, Locale locale)
  2. convertDateToString(Date dateObject, String dateFormat)
  3. convertDateToStringByFormat(Date date)
  4. convertDateToStringT(final Date date)
  5. convertDateToStringUI(Date data)
  6. convertDateToUTC(Date date)
  7. convertDateToXSDString(Date date)
  8. convertDayToString(Date aDate)
  9. dateFmtToString(Date date, SimpleDateFormat fmt)