- Date d=new Date();
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm;ss");
- Calendar c=Calendar.getInstance();
- d=c.getTime();
- int y=c.get(Calendar.YEAR);
- int m=c.get(Calendar.MONTH);
- int dd=c.get(Calendar.DAY_OF_MONTH);
- c.set(y,m,dd,00,00,00);
- d=c.getTime();
- String s=sdf.format(d);
- System.out.println(s);
复制代码
|