论坛大神
  
- 积分
- 883
- 金钱
- 883
- 注册时间
- 2011-12-25
- 在线时间
- 12 小时
|
发表于 2012-9-19 17:21:02
|
显示全部楼层
回复【楼主位】qq544215846:
---------------------------------
看看整体程序就知道了,,不能够看局部。。
timer.w_year=temp1;//得到年份
temp1=0; //这里为什么赋值为0呢?因为temp1这个变量是赋值到年,月。上面年好了,当然要清0
while(temp>=28)//超过了一个月
{ //这里==1是代表2月
if(Is_Leap_Year(timer.w_year)&&temp1==1)//当年是不是闰年/2月份
{
if(temp>=29)temp-=29;//闰年的秒钟数
else break; //这里有个跳出while(temp>=28),,想想吧
}
else
{
if(temp>=mon_table[temp1])temp-=mon_table[temp1];//平年
else break; //这里有个跳出while(temp>=28),,想想吧,呵呵
}
temp1++; //有没有看到这个??看整体程序,不要看局部。。
}
timer.w_month=temp1+1;//得到月份
timer.w_date=temp+1; //得到日期
|
|