unit DateTimeToStr;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: DateTimeToStr
// Routine: SysUtils.DateTimeToStr
// Routine: SysUtils.Now

// BeginCode
{
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;
// EndCode
// EndExample: DateTimeToStr
end.
