记录一个注意点:SimpleDateFormat转化问题
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String formatdate = simpleDateFormat.format(new Date());
//formatdate就是当前时间
注意:一定要用"yyyy-MM-dd",不能是"yyyy-MM-DD"或"yyyy-mm-dd"。
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String formatdate = simpleDateFormat.format(new Date());
//formatdate就是当前时间
注意:一定要用"yyyy-MM-dd",不能是"yyyy-MM-DD"或"yyyy-mm-dd"。