Java tutorial
//package com.java2s; import java.sql.Timestamp; import java.text.SimpleDateFormat; public class Main { public static String getDateFromDateTime(Timestamp dateTime) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); return sdf.format(dateTime).toString(); } }