[TRUCO DELPHI] Calcular los numeros de Semana.
delphi
function WeekNum(const TDT:TDateTime) : Word; var Y,M,D:Word; dtTmp:TDateTime; begin DecodeDate(TDT,Y,M,D); dtTmp := EnCodeDate(Y,1,1); Result := (Trunc(TDT-dtTmp)+(DayOfWeek(dtTmp)-1)) DIV 7; if Result <> 0 then Result := Result - 1; end;
Saludos!