Here you can find the source of parseDateToString(Date datetime)
public static String parseDateToString(Date datetime)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String parseDateToString(Date datetime) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); java.util.Date sDate = new java.util.Date(datetime.getTime()); return df.format(sDate); }// w w w.j a v a 2 s . co m }