得到当前时间
1. Calendar.getInstance().getTime();
2. new Timestamp(System.currentTimeMillis());
3. new Timestamp((Calendar.getInstance().getTime()).getTime());
--------------------------------
|
date
------------------------------------------------------
SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm");
//Calendar
Date date = Calendar.getInstance().getTime();
System.out.println(df.format(date));
//Timestamp
System.out.println(df.format(new Timestamp(System.currentTimeMillis())));
System.out.println(df.format(new Timestamp(date.getTime())));
------------------------------------------------------
rs.getTimestamp("ORIGINAL_RESPONSE_DATETIME");
Calendar c = Calendar.getInstance();
c.setLenient(false);
c.set(year, month-1, day, hour, minutes, 0);
c.set(Calendar.MILLISECOND, 0);
c.setTime(date);
c.add(Calendar.MONTH, n); //在日期上增加数个整月
new Timestamp(c.getTime().getTime());