DateTimeToStr (Object Pascal)

From Appmethod Code Examples
Jump to: navigation, search

Description

This example uses a label and a button on a form. When the user clicks the button, the current date and time are converted to a string and displayed as the caption of the label.

Code

procedure TForm1.Button1Click(Sender: TObject);
begin
  Label1.Caption := SysUtils.DateTimeToStr(Now);
end;

Uses