Autor Beitrag
max1235
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37

win 98 (aber so gut wie nie dran), win xp, win vista, xandros
delphi(delphi3+7), c#(MV), c++(codeblocks;noch ganz am Anfang vom Lernen)
BeitragVerfasst: Di 26.01.10 15:54 
Hallo Leute.
Ich habe schon wieder eine Frage: Kann man Wochentage addieren? Ich kann den Wochentag mit z.B.: label1.caption:=formatdatetime('dddd',date); ausgeben. Kann ich da auch Tage zu addieren, also dass da heute nicht dienstag sondern mittwoch oder donnerstag steht? Wenn ja, wie?

edit: wenns geht ohne in diesem fall nervende if-then-else-konstruktionen.

_________________
Max Kreie
Einige Wissen viel, andere wenig(er). Dafür sind Foren da.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19339
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Di 26.01.10 16:00 
Addiere einfach z.B. 1, 2, ... zum Datum. Denn 1 entspricht einem Tag. ;-)
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Di 26.01.10 16:02 
Meinst du sowas:
ausblenden Delphi-Quelltext
1:
label1.caption:=formatdatetime('dddd',date+3);					


Ansonsten gibt es noch DayOfWeek, wenn ich mich richtig erinnere. Damit kannst du den Wochentag bestimmen. Die Zählung beginnt meines Wissens mit 0 für den Sonntag. Steht aber auch in der DOH.
max1235 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37

win 98 (aber so gut wie nie dran), win xp, win vista, xandros
delphi(delphi3+7), c#(MV), c++(codeblocks;noch ganz am Anfang vom Lernen)
BeitragVerfasst: Di 26.01.10 16:03 
@jaenike: erstmal danke für die antwort. aber wie? ich habe formatdatetime('dddd+1', date); und formatdatetime('dddd'+1); schon versucht

edit:
@jasocul: danke. klappt.

_________________
Max Kreie
Einige Wissen viel, andere wenig(er). Dafür sind Foren da.
der organist
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 467
Erhaltene Danke: 17

WIN 7
NQC, Basic, Delphi 2010
BeitragVerfasst: Di 26.01.10 16:42 
user profile iconjasocul hat folgendes geschrieben Zum zitierten Posting springen:
Meinst du sowas:
ausblenden Delphi-Quelltext
1:
label1.caption:=formatdatetime('dddd',date+3);					




user profile iconmax1235 hat folgendes geschrieben Zum zitierten Posting springen:
@jaenike: erstmal danke für die antwort. aber wie? ich habe formatdatetime('dddd+1', date); und formatdatetime('dddd'+1); schon versucht

edit:
@jasocul: danke. klappt.


:D:D was fällt dir auf? Das 'dddd' gibt der Funktion doch nur an, in welchem Format das Datum ausgegeben wird. Das +1 musst du schon bei dem Datum, das du ausgeben möchtest, selber angeben.

_________________
»Gedanken sind mächtiger als Waffen. Wir erlauben es unseren Bürgern nicht, Waffen zu führen - warum sollten wir es ihnen erlauben, selbständig zu denken?« Josef Stalin
max1235 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37

win 98 (aber so gut wie nie dran), win xp, win vista, xandros
delphi(delphi3+7), c#(MV), c++(codeblocks;noch ganz am Anfang vom Lernen)
BeitragVerfasst: Di 26.01.10 16:44 
Danke. Wie gesagt klappt es.

_________________
Max Kreie
Einige Wissen viel, andere wenig(er). Dafür sind Foren da.