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



BeitragVerfasst: Mo 30.01.06 09:29 
Hi,

es ist eigentlich schon fast peinlich, aber ich suche mir den Wolf und komm einfach nicht drauf. Ich will das aktuelle Datum auslesen und mit einem String vergleichen. Da das die ganze Zeit nicht funktioniert hat, habe ich nach langem Suchen festgestellt, dass das Datum nicht ausgelesen wird. Es bleibt leer? Date wurde auch nicht als Variable definiet, somit auch nicht überschrieben. Warum ist Date leer?

THX
Danny87
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Mo 30.01.06 09:52 
hast dus so in der art gemacht?

ausblenden Delphi-Quelltext
1:
label1.Caption := DateToStr(Date);					



gruss daniel
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mo 30.01.06 09:56 
Dies erhalte ich als Fehlermeldung.

[Fehler] Unit1.pas(457): Es gibt keine überladene Version von 'DateToStr', die man mit diesen Argumenten aufrufen kann


Ich habe aber die Suche gestartet und kein weiteren Eintrag für Date gefunden.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 30.01.06 09:58 
Von welchem Typ ist denn bei dir die Variable Date? Wenn du nur das Aktuelle Datum brauchst, kannst du es auch mit label1.Caption := DateToStr(Now); anzeigen lassen.

_________________
We are, we were and will not be.
Danny87
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Mo 30.01.06 10:03 
seltsam, bei mir funktionierts.

Markier mal DateToStr und drück F1. Vielleicht hilt dir das weiter.



gruss daniel
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mo 30.01.06 10:17 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.Button1Click(Sender: TObject);
begin
  If FormatDateTime('dd.mm.yyyy',Date)='30.01.2006' then
  ShowMessage('Datum ist Richtig !')
  else
  ShowMessage('Datum ist Falsch !');
end;
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mo 30.01.06 10:18 
Bei einer neuen Anwendung funktioniert alles so, wie gehabt. Aber bei meiner nicht, obwohl nirgens Date deklariert wurde.
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mo 30.01.06 10:48 
Gausi macht das Rennen. Ich bedanke mich bei allen, die sich trotzdem Kopf gemacht haben uns mir helfen wollten. DateToStr(Now) liefert das aktuelle Datum. Weshalb Date bzw. DateToStr(Date) nicht funktioniert hat, bleibt ein Rätzel.

Thanks...
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mo 30.01.06 10:51 
wie kann sowas passieren 30.1.2006 ??? Ohne 0 vor der 1??? :gruebel:
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mo 30.01.06 11:04 
ausblenden Delphi-Quelltext
1:
Caption:=FormatDateTime('dd.mm.yyyy',Date);					
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mo 30.01.06 11:08 
47 Benutzer starten das selbe Programm. Diese Programm liest bei jedem die unter anderem das Datum aus. Bei den meisten 30.01.2006 bei drei 30.1.2006, obwohl ALLE das selbe Programm öffnen.
Stefan.Buchholtz
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 612

WIN 2000, WIN XP, Mac OS X
D7 Enterprise, XCode, Eclipse, Ruby On Rails
BeitragVerfasst: Mo 30.01.06 11:12 
user profile iconmexx hat folgendes geschrieben:
47 Benutzer starten das selbe Programm. Diese Programm liest bei jedem die unter anderem das Datum aus. Bei den meisten 30.01.2006 bei drei 30.1.2006, obwohl ALLE das selbe Programm öffnen.


DateToStr benutzt das in Windows eingestellte Datumsformat. Um ein festes Format zu verwenden kannst du FormatDateTime('dd.mm.yyyy', Date); benutzen.

Stefan

_________________
Ein Computer ohne Windows ist wie eine Schokoladentorte ohne Senf.