Date类
date2long 日期相加
Date now = new Date(); // 获取现在的时间
long date2long = now.getTime(); // Date to long
可以对long类型数进行相加。实现Date的相加
Date long2Date = new Date(longtime); // param是long类型数值,转成Date
定义到毫秒
SimpleDateFormat sdf=new SimpleDateFormat(“yyyy-MM-dd hh:mm:ss.SSS”)
//SSS就是毫秒
IOUtils写出字符串到文件
IOUtils.write(s, new FileOutputStream(“C:\Users\liuqi\exceeddata\test\json\basis.json”), “utf-8”); // 写出是,使用FileOutputStream,而非Writer