Here you can find the source of dateToStringShort(Date date)
public static String dateToStringShort(Date date)
//package com.java2s; import java.text.SimpleDateFormat; public class Main { public static String dateToStringShort(Date date) { if (date == null) return ""; return FormatDate(date, "yyyy-MM-dd"); }// ww w . j av a 2s.c om public static String FormatDate(Date date, String sf) { if (date == null) return ""; SimpleDateFormat dateformat = new SimpleDateFormat(sf); return dateformat.format(date); } }