(Gast)
n/a Beiträge
|
Re: Anzahl Tage im Monat
14. Mär 2009, 12:07
dann fügt man das einfach mit hinzu
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) and not(round(strtoint(formatdatetime('yyyy', date)) / 400) = strtoint(formatdatetime('yyyy', date)) / 400) then result := 29
else result := 28;
end;
end;
wo ist das problem??
|
|
Zitat
|