summaryrefslogtreecommitdiff
path: root/fpcdocs/datutex/ex39.pp
blob: 4de8b367be55f4ed63c3a37eb59ccf39dc4dafe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Program Example39;

{ This program demonstrates the EndOfADay function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"End of the day : "dd mmmm yyyy hh:nn:ss';

Var
  Y,M,D : Word;

Begin
  Y:=YearOf(Today);
  M:=MonthOf(Today);
  D:=DayOf(Today);
  Writeln(FormatDateTime(Fmt,EndOfADay(Y,M,D)));
  DecodeDateDay(Today,Y,D);
  Writeln(FormatDateTime(Fmt,EndOfADay(Y,D)));
End.