1 //获取当天0点时间 2 public static String getDate1(){ 3 4 Calendar cal = Calendar.getInstance(); 5 cal.set(Calendar.HOUR_OF_DAY, 0);//控制时 6 cal.set(Calendar.MINUTE, 0);//控制分 7 cal.set(Calendar.SECOND, 0);//控制秒 8 9 Date time = cal.getTime(); 10 11 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 12 String format = sdf.format(time); 13 14 return null; 15 }
Calendar.getInstance()用法 https://blog.csdn.net/qq_45536740/article/details/105261786
DATE_FORMAT函数用法 https://blog.csdn.net/weixin_41400063/article/details/83150919 DATE_FORMAT(date, format) 函数用法 https://www.jianshu.com/p/a4f9ebcb9322标签:set,format,日历,用法,日期,时间,https,cal,Calendar From: https://www.cnblogs.com/mingruifeng/p/16913061.html