unit DateTime;

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: DateTime
// Variable: SysUtils.CurrencyFormat
// Variable: SysUtils.DateSeparator
// Variable: SysUtils.ShortDateFormat
// Routine: SysUtils.DateToStr

// BeginCode
{
This example uses a label and a button on a form. When the 
user clicks the button, the current date displays in the 
caption of the label. Because some of the date variables are 
assigned new values, the format of the date in the label 
changes. For example, if the date is 9/15/94, the date 
displays as 9-15-1994.
} 
procedure TForm1.Button1Click(Sender: TObject);
begin
  DateSeparator := '-';
  ShortDateFormat := 'm/d/yyyy';
  Label1.Caption := DateToStr(Date);
end;
// EndCode
// EndExample: DateTime
end.
