int daycount=0,syear=2005,eyear=2006;
GregorianCalendar g;
for(int i=syear;i<eyear;i++)
{
g=new GregorianCalendar(i,11,30);//11月30日为每年最后一天
daycount=daycount+g.get(GregorianCalendar.DAY_OF_YEAR)+1;//得到年天数和
}
g=new GregorianCalendar(syear,1,1);//启始日期
int sday=g.get(GregorianCalendar.DAY_OF_YEAR);
g=new GregorianCalendar(eyear,1,1);//结束日期
int eday=g.get(GregorianCalendar.DAY_OF_YEAR);
System.out.println(eday+daycount-sday);//得到天数差