标签:day new str style oca set public time 记录
public static void main(String[] args) { Calendar c1 = new GregorianCalendar(); c1.set(Calendar.HOUR_OF_DAY, 0); c1.set(Calendar.MINUTE, 0); c1.set(Calendar.SECOND, 0); System.out.println(c1.getTime().toLocaleString()); Calendar c2 = new GregorianCalendar(); c2.set(Calendar.HOUR_OF_DAY, 23); c2.set(Calendar.MINUTE, 59); c2.set(Calendar.SECOND, 59); System.out.println(c2.getTime().toLocaleString()); /*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); Date start = calendar.getTime(); calendar.add(Calendar.DAY_OF_MONTH, 1); calendar.add(Calendar.SECOND, -1); Date end = calendar.getTime(); System.out.println(start); System.out.println(end);*/ }
嗯,先记录一个
标签:day new str style oca set public time 记录
原文地址:https://www.cnblogs.com/wuhu/p/8871970.html