使用以下的语句
pstmt.setDate("UpdateDate", rs.getDate("UpdateDate"));
为什么插入数据库的是yyyy-MM-dd
而不是yyyy-MM-dd HH:mm:ss
我想插入的是yyyy-MM-dd HH:mm:ss这种格式的该怎么做了
pstmt.setDate("UpdateDate", rs.getDate("UpdateDate"));
为什么插入数据库的是yyyy-MM-dd
而不是yyyy-MM-dd HH:mm:ss
我想插入的是yyyy-MM-dd HH:mm:ss这种格式的该怎么做了
/**
* 取出现在的时间,年-月-日 小时-分-秒
* @param currentTime long
* @return String
*/
public String getCurrentDate(long currentTime){
DateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String time = df.format(new Date(currentTime));
return time;
}