SimpleDateFormat mFormatTimeOnly = new SimpleDateFormat("yyyy.MM.dd-HH.mm.ss", Locale.getDefault()); Date dDate = new Date(); String strTime = mFormatTimeOnly.format(dDate);
在你插入的时候写不就得了: insert into table1(date1) values(getdate());//sql server insert into table1(date1) values(sysdate());//oracle
Date dDate = new Date();
String strTime = mFormatTimeOnly.format(dDate);
insert into table1(date1) values(getdate());//sql server
insert into table1(date1) values(sysdate());//oracle