type
TDateRec =
record
Date:
Array
[
0..2
]
of
String
;
private
function
GetDate(
const
Index:
Integer
):
String
;
public
property
Day:
String
index
0
read GetDate;
property
Month:
String
index
1
read GetDate;
property
Year:
String
index
2
read GetDate;
end
;
TForm8 =
class
(TForm)
Timer1: TTimer;
procedure
Timer1Timer(Sender: TObject);
private
public
end
;
var
Form8: TForm8;
implementation
{$R *.dfm}
procedure
TForm8
.
Timer1Timer(Sender: TObject);
Var
DateRec: TDateRec;
begin
Caption := DateRec
.
Day +
'.'
+ DateRec
.
Month +
'.'
+ DateRec
.
Year;
end
;
function
TDateRec
.
GetDate(
const
Index:
Integer
):
String
;
Var
FS: TFormatSettings;
begin
FS
.
ShortDateFormat :=
'ddmmyyyy'
;
case
Index
of
0
: Result := Copy(DateToStr(Now, FS),
1
,
2
);
1
: Result := Copy(DateToStr(Now, FS),
3
,
2
);
2
: Result := Copy(DateToStr(Now, FS),
5
,
4
);
end
;
end
;