Here you can find the source of toString(Date date)
public static String toString(Date date)
//package com.java2s; /*/*from w w w . ja va 2s . c o m*/ * All Sigmah code is released under the GNU General Public License v3 * See COPYRIGHT.txt and LICENSE.txt. */ import java.sql.Timestamp; import java.util.Date; public class Main { public static String toString(Timestamp timestamp) { return timestamp.getTime() + "." + timestamp.getNanos(); } public static String toString(Date date) { if (date instanceof Timestamp) { return toString((Timestamp) date); } else { return Long.toString(date.getTime()); } } }