Timestamp timestamp1 = new Timestamp((new Date()).getTime()); 获取当前时间,时间格式为2018-09-13 10:35:48.873
timestamps类型,当前时间减一秒
SimpleDateFormat d = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Timestamp time = Timestamp.valueOf(d.format(new Date(System.currentTimeMillis() - 1* 1000))); (减微秒)