Determine number of seconds since 1970 for both dates
Subtract smallest from largest number
divide by /60/60/24 for # days
example to get you started
1 2 3 4 5 6 7 8 9 10 11 12 13
#include <iostream>
#include <string>
#include <time.h>
usingnamespace std;
int main()
{
time (0);
cout << "Current time in Seconds from 1/1/1970 = " << time (0)<<endl;
cout << "Current time in days from 1/1/1970 = " << time (0)/60/60/24<<endl;
return 0;
}
thanks but not sure if that is what I need be able to input date 2 dates and for example 21/02 /13 and 10/03/13 then look for a match in my payslip.txt
and calculate the total wages between them . think ihave to try and convert the date in some way i know how to search one date but and keep a running total .