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