SimpleDateFormat bartDateFormat = new SimpleDateFormat ("yyyy-MM-dd HH: mm: ss.SSS");
bartDateFormat = getTime () tostring ().;
not to die , how to write ?
------ Solution ---------------------------------------- ----
SimpleDateFormat bartDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
String time= bartDateFormat.format(Calendar.getInstance().getTime());
System.out.println(time);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(sdf.format(new Date()));
sql has cast function
------ For reference only -------------------------------- -------
write separately , finished in a combined into sql time format to try
没有评论:
发表评论