I saw that it has a function in time.h that calculates the difference between date I went to documentation link time.h , I did not quite understand how to perform this calculation, for example I wanted to calculate the difference between the date 12/09/2018 and 12/09/1997
Code that the page provided
#include <stdio.h> /* printf */
#include <time.h> /* time_t, struct tm, difftime, time, mktime */
int main ()
{
time_t now;
struct tm newyear;
double seconds;
time(&now); /* get current time; same as: now = time(NULL) */
newyear = *localtime(&now);
newyear.tm_hour = 0;
newyear.tm_min = 0;
newyear.tm_sec = 0;
newyear.tm_mon = 0;
newyear.tm_mday = 1;
seconds = difftime(now, mktime(&newyear));
printf ("%.f seconds since new year in the current timezone.\n", seconds);
return 0;
}