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

{ This program demonstrates the StartOfAWeek function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"First day of this week : "dd mmmm yyyy hh:nn:ss';
  Fmt2 = '"Second day of this week : "dd mmmm yyyy hh:nn:ss';

Var
  Y,W : Word;

Begin
  Y:=YearOf(Today);
  W:=WeekOf(Today);
  Writeln(FormatDateTime(Fmt,StartOfAWeek(Y,W)));
  Writeln(FormatDateTime(Fmt2,StartOfAWeek(Y,W,2)));
End.