获取当前时间,System.currentTimeMillis()得到离1970年1月1日的的毫秒数
Date date = new Date(System.currentTimeMillis())
转换成yyyy-MM-dd的格式,以字符串的格式存到数据库
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
sdf.format(new Date(System.currentTimeMillis()))
获取当前时间,System.currentTimeMillis()得到离1970年1月1日的的毫秒数
Date date = new Date(System.currentTimeMillis())
转换成yyyy-MM-dd的格式,以字符串的格式存到数据库
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
sdf.format(new Date(System.currentTimeMillis()))