就是这个:
(trunc(Now-EncodeDate(CurrentYear,1,1))div 7)+min(1,max(0,Abs(DayOfWeek(Now)-DayOfWeek(EncodeDate(CurrentYear,1,1)))))
可以简化成:
weekid:=trunc(Now-EncodeDate(CurrentYear,1,1))div 7;
if DayOfWeek(Now)=DayOfWeek(EncodeDate(CurrentYear,1,1)) then
Inc(weekid);