Here you can find the source of date2Str(Date value)
private static String date2Str(Date value)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static String date2Str(Date value) { if (value == null) return null; //if(defaultsdf==null)defaultsdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(value); }/*from ww w . jav a2 s . com*/ }