Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static String parseDateToString(Date date_received) { //2014-06-28 14:56:59 SimpleDateFormat dateFormat_received = new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss", Locale.getDefault()); String date_string = null; date_string = dateFormat_received.format(date_received); return date_string; } }