Date 工具类的使用总结
毫秒值和Date
Date date = new Date(long);
Long long = date.gettime();
字符串和Date的转换
SimpleDateFormat sdf = new SimpleDateFormat(“yyyy-MM-dd”);
Date date = sdf.parse(str);
String str = sdf.format(date);
Date 和 calender的转化
Calender cal = Calender.getInstance();
cal.set(date);
Date date = cal.getTime();
mysql 日期转化成字符串
DATE_FORMAT(NOW(),’%m-%d-%Y’) 12-30-2019