50,687
社区成员
发帖
与我相关
我的任务
分享
public static void main(String[]args) throws InterruptedException{
Calendar xxx=Calendar.getInstance();
Calendar yyyy=Calendar.getInstance();
xxx.set(2014,3,29);
System.out.println(new SimpleDateFormat("yyyy/MM/dd-HH:mm:ss:SSS").format(xxx.getTime()));
yyyy.set(2014,3,29);
System.out.println(new SimpleDateFormat("yyyy/MM/dd-HH:mm:ss:SSS").format(yyyy.getTime()));
while(xxx.before(yyyy)){
int day=xxx.get(Calendar.DAY_OF_MONTH);
System.out.println(day);
xxx.add(Calendar.DATE,1);
}
Calendar begin=Calendar.getInstance();
Calendar end=Calendar.getInstance();
begin.set(2014,3,25);
System.out.println(new SimpleDateFormat("yyyy/MM/dd-HH:mm:ss:SSS").format(begin.getTime()));
end.set(2014,3,25);
System.out.println(new SimpleDateFormat("yyyy/MM/dd-HH:mm:ss:SSS").format(end.getTime()));
while(begin.before(end)){
int d=begin.get(Calendar.DAY_OF_MONTH);
System.out.println(d);
begin.add(Calendar.DATE,1);
}
}