This sample code calculates date difference (in days) between today and a file date.
You can use it as a trace for your job.
It's based on mktime () function that returns the number of secs since January 1, 1900, on which you can calculate knowing that a day is 86400 secs.
#include
#include
static struct tm *zz;
static int err, mm, dd, yy;
static unsigned long ll;
static unsigned long fdate;
ll = time (NULL); // Today
err = GetFileDate ("yourfile.txt", &mm, &dd, &yy);
if (err) {
MessagePopup ("Error", Error in GetFileDate");
}
else {
zz = now; // Inizialize structure
zz->tm_year = yy - 1900;
zz->tm_mon = mm;
zz->tm_mday = dd;
fdate = mktime (zz);
printf ("File was created %.0f days ago.\n", (double)(ll - fdate) / 86400.0);
}
A little tricky and perhaps not 'politically correct', but it works.
Hope this helps.
Roberto