1.获取当前时间
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
System.out.println(df.format(new Date()));// new Date()为获取当前系统时间
2.类型转换
StringUtils.isEmpty(user.getId()))
//org.apache.commons.lang3包下的StringUtils类,判断是否为空的方法参数是字符序列类,也就是String类型 //org.springframework.util包下的参数是Object类,也就是不仅仅能判断String类型,还能判断其他类型,比如Long等类型。