java中获取当天零点零分时间

/**
	 * 获得当天零时零分零秒
	 * @return
	 */
	public static Date initDateByDay(){
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(new Date());
		calendar.set(Calendar.HOUR_OF_DAY, 0);
		calendar.set(Calendar.MINUTE, 0);
		calendar.set(Calendar.SECOND, 0);
		return calendar.getTime();
	}

 

你可能感兴趣的:(java中获取当天零点零分时间)