//创建SimpleDateFormat对象,写日期格式
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
日期模式:
yyyy 年份
MM 月份
dd 月中的天数
HH 0-23小时
mm 小时中的分钟数
ss 秒