libtime++: Date and time calculation

◆ time_sprint()

subroutine time_sprint ( integer, dimension(7)  date,
character*(*)  string 
)

Definition at line 32 of file time_sprint.f.

References time_copy(), time_getdate(), and time_norm().

32 c
33 c Print date to string (string must be 35 characters long at least)
34 c
35 c input:
36 c date: date record to be printed
37 c output:
38 c string: text representation of date value
39 c
40 c last change: V2.00 (05/08/2000)
41 c
42  integer date(7)
43  character*(*) string
44 cE
45  character*(35) ostring
46  integer i, day, month, d(7)
47 c
48  call time_copy(date, d)
49  call time_norm(d)
50 c check for relative date
51  if (d(1).gt.0) then
52  call time_getdate(day, month, d)
53  write(ostring, 1) d(2), day, month, d(1), (d(i), i=3,7)
54  1 format(i3.3,1x,2(i2.2,1h/),i4.4,1x,i2.2,2(1h:,i2.2),1h.,2(i3.3))
55  else
56  if (d(2).eq.1) then
57  write(ostring, 2) (d(i), i=2,7)
58  else
59  write(ostring, 3) (d(i), i=2,7)
60  endif
61  2 format(i5,' day ',i2.2,2(1h:,i2.2),1h.,2(i3.3))
62  3 format(i5,' days ',i2.2,2(1h:,i2.2),1h.,2(i3.3))
63  endif
64  string=ostring
65  return
void time_getdate(timeint *day, timeint *month, time_Ts Date)
Definition: ctime_getdate.c:36
void time_copy(time_Ts Date1, time_Ts *Pdate2)
Definition: ctime_copy.c:33
void time_norm(time_Ts *Pdate)
Definition: ctime_norm.c:33
Here is the call graph for this function: