Returns the current date and time.
function Now: TDateTime;
TDateTime Now();
SysUtils
Returns the current date and time, corresponding to the sum of the value returned by the global Date and Time functions.
C++ Examples:
/* This example uses a label and a button on a form. When the user clicks the button, the current date and time is converted to a string and displayed as the caption of the label: */ void __fastcall TForm1::Button1Click(TObject *Sender) { Label1->Caption = DateTimeToStr(Now()); }
Delphi Examples:
{ This example uses a label and a button on a form. When the user clicks the button, the current date and time is converted to a string and displayed as the caption of the label: } procedure TForm1.Button1Click(Sender: TObject); begin Label1.Caption := SysUtils.DateTimeToStr(Now); end;
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|