Here you can find the source of convertDateToText(Date date)
Parameter | Description |
---|---|
date | the date which will be converted to string form |
public static String convertDateToText(Date date)
//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; } }