[Delphi] De tijd weten in Delphi

Pagina: 1
Acties:

  • Crysania
  • Registratie: September 2000
  • Laatst online: 08:58
ik wil een variabelen hebben met daarin de tijd, hoe is dit mogelijk??

Verwijderd

var time : string
begin
time := timetostring(now);
label1.caption := time;
label2.caption := formatdatetime('HH-MM-SS', now) // geloof ik, zo uit me hoofd :)
label3.caption := formatdatetime('DD-MM-YYYY', now);
end;
:)

  • Tom-my
  • Registratie: November 2000
  • Laatst online: 19-06 09:25

Tom-my

w03iz0rz

Ganie werken, time is al een gereserveerd wordt hoor :)

var
tijd : string

begin

tijd := timetostr(time);
label1.caption:= tijd;
end;

nou bij een ontimer event ff deze procedure aanroepen en klaaaaar!

"Then there was the man who drowned crossing a stream with an average depth of six inches."


  • Crysania
  • Registratie: September 2000
  • Laatst online: 08:58
ik heb hem, (met wat aanpassingen)
code:
1
2
3
4
5
6
7
8
9
10
11
12
procedure TForm1.Button1Click(Sender: TObject);

var time : string;
begin

time := timetostr(now);
label1.caption := time;
label2.caption := formatdatetime('HH-MM-SS', now);
label3.caption := formatdatetime('DD-MM-YYYY', now);
end;

end.

thnx

  • MerijnB
  • Registratie: Oktober 2000
  • Laatst online: 10:06
wat je dus vooral niet vergeten is dat in FormatDateTime M voor maand staat, niet voor minuut!
zou dus FormatDateTime(now, 'hh-nn-ss') moeten zijn

A software developer is someone who looks both left and right when crossing a one-way street.

Dé antenne-innovatie voor de korte golf