Java examples for java.sql:Timestamp
get Date Stamp
//package com.java2s; import java.util.Date; public class Main { public static void main(String[] argv) throws Exception { Date date = new Date(); System.out.println(getDateStamp(date)); }/*from w ww. ja va 2 s.c o m*/ public static String getDateStamp(Date date) { return new java.sql.Timestamp(date.getTime()).toString(); } }