在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
/*得到年月日转化为星期几*/ LOCAL ulong_t DateWeekGet(ulong_t year,ulong_t month,ulong_t day) { ulong_t c = 0; ulong_t s = 0; ulong_t w = 0; ulong_t week_day = 0; if (month==1) c=day; else if (month==2) c=31+day; else if (month==3) c=31+28+day; else if (month==4) c=31+28+31+day; else if (month==5) c=31+28+31+30+day; else if (month==6) c=31+28+31+30+31+day; else if (month==7) c=31+28+31+30+31+30+day; else if (month==8) c=31+28+31+30+31+30+31+day; else if (month==9) c=31+28+31+30+31+30+31+31+day; else if (month==10) c=31+28+31+30+31+30+31+31+30+day; else if (month==11) c=31+28+31+30+31+30+31+31+30+31+day; else if (month==12) c=31+28+31+30+31+30+31+31+30+31+30+day; if (month>2) { if (year%100==0) { if (year%400==0) c=c+1; } else if (year%4==0) c=c+1; } s=(year-1)*365+(year-1)/4-(year-1)/100+(year-1)/400+c; w=s%7; if(w == 0) { week_day = 7; } else { week_day = w; } return week_day; } static char *monthNames[] = { "???", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; static char *weekNames[] = { "???", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" };
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论