libtime++: Date and time calculation

◆ subaddtest()

void subaddtest ( time_Ts  date1,
time_Ts  date2 
)

Definition at line 36 of file ctlibtime.c.

References time_add(), TIME_SLEN, time_sprint(), and time_sub().

Referenced by main(), and testlibtime().

39 {
40  time_Ts date3, date4;
41  char string[TIME_SLEN];
42  strcpy(string,time_sprint(date1));
43  printf("*** date1: %s\n",string);
44  strcpy(string,time_sprint(date2));
45  printf(" date2: %s\n",string);
46  time_sub(date1, date2, &date3);
47  strcpy(string,time_sprint(date3));
48  printf(" date1-date2=date3: %s\n",string);
49  time_add(date3, date2, &date4);
50  strcpy(string,time_sprint(date4));
51  printf(" date3+date2=date4: %s\n",string);
52 } /* subaddtest */
char * time_sprint(time_Ts Date)
Definition: ctime_sprint.c:39
void time_add(time_Ts Date1, time_Ts Date2, time_Ts *Pdate3)
Definition: ctime_add.c:33
void time_sub(time_Ts Date1, time_Ts Date2, time_Ts *Pdate3)
Definition: ctime_sub.c:33
#define TIME_SLEN
Definition: libtime.h:113
Here is the call graph for this function:
Here is the caller graph for this function: