该博客用于收集一些平时总是要用到却老是忘记怎么写的Java代码
获得当前时间
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.time=df.format(new Date());