~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to docs/datutex/ex100.pp

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2005-05-30 11:59:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050530115910-x5pbzm4qqta4i94h
Tags: 2.0.0-2
debian/fp-compiler.postinst.in: forgot to reapply the patch that
correctly creates the slave link to pc(1).  (Closes: #310907)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Program Example100;
 
2
 
 
3
{ This program demonstrates the CompareTime function }
 
4
 
 
5
Uses SysUtils,DateUtils;
 
6
 
 
7
Const
 
8
  Fmt = 'dddd dd mmmm yyyy hh:nn:ss.zzz';
 
9
 
 
10
Procedure Test(D1,D2 : TDateTime);
 
11
 
 
12
Var
 
13
  Cmp : Integer;
 
14
 
 
15
begin
 
16
  Write(FormatDateTime(Fmt,D1),' has ');
 
17
  Cmp:=CompareDateTime(D1,D2);
 
18
  If Cmp<0 then
 
19
    write('earlier time than ')
 
20
  else if Cmp>0 then
 
21
    Write('later time than ')
 
22
  else
 
23
    Write('equal time with ');
 
24
  Writeln(FormatDateTime(Fmt,D2));
 
25
end;
 
26
 
 
27
Var
 
28
  D,N : TDateTime;
 
29
 
 
30
Begin
 
31
  D:=Today;
 
32
  N:=Now;
 
33
  Test(D,D);
 
34
  Test(N,N);
 
35
  Test(N+1,N);
 
36
  Test(N-1,N);
 
37
  Test(N+OneSecond,N);
 
38
  Test(N-OneSecond,N);
 
39
End.
 
 
b'\\ No newline at end of file'