#include #include using namespace std; bool isLeapYear(int y){ if(y % 400 == 0) return true; if(y % 100 == 0) return false; return y % 4 == 0 ; } int secondsSince( int usersBYear, int usersBmonth, int usersBDay){ time_t t = time(0); // current time: http://cplusplus.com/reference/clibrary/ctime/time/ struct tm * now = localtime(&t); // http://cplusplus.com/reference/clibrary/ctime/localtime/ int day = now->tm_mday; int month = now->tm_mon + 1; int year = now->tm_year + 1900; int differenceInYears = year - usersBYear; //now convert that to days -> seconds cout<< "current date is "<< month << "/"<< day<<"/"<< year << endl; return 0; } int main() { int yourBirthYear, yourBirthMonth, yourBirthDay; yourBirthYear = 2000; yourBirthMonth = 12; yourBirthDay = 2; int result = secondsSince( yourBirthYear, yourBirthMonth, yourBirthDay ) ; cout << "There were "<< result << " seconds between now and your birthday"<