libtime++: Date and time calculation

◆ time_compare()

integer function time_compare ( integer, dimension(7)  date1,
integer, dimension(7)  date2 
)

Definition at line 32 of file time_compare.f.

References time_compare(), and time_util_warning().

32 c
33 c Compare values of date1 and date2.
34 c Both must be absolute or both must be relative.
35 c
36 c result = 0 for date1 = date2
37 c result = -1 for date1 < date2
38 c result = 1 for date1 > date2
39 c
40 c input:
41 c date1: primary time record
42 c date2: secondary time record
43 c
44 c last change: V2.00 (05/08/2000)
45 c
46  integer date1(7), date2(7)
47 cE
48  integer result, i
49 c
50  if (((date1(1).eq.0).and.(date2(1).eq.0)).or.
51  & ((date1(1).ne.0).and.(date2(1).ne.0))) then
52  result=0
53  i=1
54  1 if (date1(i).gt.date2(i)) then
55  result=1
56  elseif (date1(i).lt.date2(i)) then
57  result=-1
58  else
59  i=i+1
60  if (i.lt.8) goto 1
61  endif
62  else
63  call time_util_warning('time_compare',
64  & 'do not mix absolute and relative times')
65  call time_util_warning('time_compare',
66  & 'routine skipped... (result=-2)')
67  result=-2
68  endif
69  time_compare=result
70  return
subroutine time_util_warning(caller, text)
integer time_compare(time_Ts Date1, time_Ts Date2)
Definition: ctime_compare.c:35
Here is the call graph for this function: