Autor Beitrag
mexx
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Di 03.01.06 08:48 
Hallo,

ich möchte das Datum vom ersten Sonntag im Monat ermitteln. Gibt es dafür einen bestehende Funktion? Habe es schin mit google versucht, aber nix gefunden.

Gruß mexx
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Di 03.01.06 09:07 
ich glaube nicht, dass es da bereits eine funktion gibt.

möglich wäre es wie folgt:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
function FirstSunday (AMonth, AYear : Integer) : tDate;
begin
  Result := IncDay (
      EncodeDateTime (AYear, AMonth, 1, 0, 0, 0, 0),
      8 - DayOfWeek (EncodeDateTime (AYear, AMonth, 1, 0, 0, 0, 0))
    );
end;


ob´s funktioniert musst du selbst ausprobieren. ;-)

lg martin

_________________
Ein Nutzer der Ecke ;-)
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Di 03.01.06 15:32 
Super, funktioniert!
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Di 03.01.06 15:38 
Bitte. ;-)

_________________
Ein Nutzer der Ecke ;-)