(Gast)
n/a Beiträge
|
Re: Anzahl Tage im Monat
14. Mär 2009, 11:59
sonst dieses script hätte auch funkitioniert
Delphi-Quellcode:
function TForm1.getdaysinmonth(date: TDATETIME): integer;
const
monthday: array[1..12] of integer = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
begin
if strtoint(formatdatetime('m', date)) <> 2 then
begin
result := monthday[strtoint(formatdatetime('m', date))];
end
else
begin
if round(strtoint(formatdatetime('yyyy', date)) / 4) = strtoint(formatdatetime('yyyy', date)) / 4 then result := 29
else result := 28;
end;
end;
|
|
Zitat
|