Here you can find the source of dateToString(Date fecha)
public static String dateToString(Date fecha)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final SimpleDateFormat formatoFecha = new SimpleDateFormat("dd/MM/yyyy"); public static String dateToString(Date fecha) { try {//from w w w .j a va2 s . c o m return formatoFecha.format(fecha); } catch (Exception e) { return ""; } } }