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