Here you can find the source of datetoStr3(Date date)
public static String datetoStr3(Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String dateToStr3(Date date) { if (date == null) { return ""; }//from w w w .j a va 2 s . c o m SimpleDateFormat sdate = new SimpleDateFormat("yyyy-MM-dd HH:mm"); return sdate.format(date); } public static String datetoStr3(Date date) { if (date == null) { return ""; } SimpleDateFormat sdate = new SimpleDateFormat("yyyy/MM/dd"); return sdate.format(date); } }