在java.sql.Date的系统时间上加上30天,并写入oracle 思路:通过 Calendar.getInstance() 获得对象,然后 add() 方法添加 时间,再通过 new java.sql.Date()转换为sql的Date Calendar c = Calendar.getInstance(); c.add(Calendar.DATE,30); Date dd = new Date(c.getTimeInMillis()); System.out.println(dd);
--DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 取当前年月日时分秒 currentTime=System.DateTime.Now; 取当前年 int 年=currentTime.Year; 取当前月 int 月=currentTime.Month; 取当前日 int 日=currentTime.Day; 取当前时 int 时=currentTime.Hour; 取当前分