71
183
0
中级会员
u8 RTC_Get_Week(u16 year,u8 month,u8 day) { u16 temp2; u8 yearH,yearL; yearH=year/100; yearL=year%100; // 如果为21世纪,年份数加100 if (yearH>19)yearL+=100; // 所过闰年数只算1900年之后的 temp2=yearL+yearL/4; temp2=temp2%7; temp2=temp2+day+table_week[month-1]; if (yearL%4==0&&month<3)temp2--;
return(temp2%7); }
使用道具 举报
25
683
论坛大神
3
21
本版积分规则 发表回复 回帖后跳转到最后一页
查看 »
正点原子公众号
|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )
GMT+8, 2025-7-19 04:59
Powered by OpenEdv-开源电子网
© 2001-2030 OpenEdv-开源电子网