import java.text.SimpleDateFormat;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(sdf.format(new Date()));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(sdf.format(new Date()));
java.sql.Timestamp ts = new java.sql.Timestamp(System.currentTimeMillis());System.out.println(ts.toString().substring(0,19));
//ok!!
System.out.println(time);