Here you can find the source of dateTimeToStr(java.util.Date date)
public static String dateTimeToStr(java.util.Date date)
//package com.java2s; import java.text.SimpleDateFormat; public class Main { private static final String SimpleDateTimeFormat = "yyyy-MM-dd HH:mm:ss"; public static String dateTimeToStr(java.sql.Date sqlDate) { if (sqlDate == null) { return null; } else {//from ww w. j a v a 2 s . c o m return (new SimpleDateFormat(SimpleDateTimeFormat)).format(sqlDate); } } public static String dateTimeToStr(java.util.Date date) { if (date == null) { return null; } else { return (new SimpleDateFormat(SimpleDateTimeFormat)).format(date); } } }