I want to know how to find which is bigger date using a c program
kindly help me out plz....
Thanks
You can use the difftime function:
#include
#include
int main(void) {
time_t date1, date2;
// initialize date1 and date2...
double seconds = difftime(date1, date2);
if (seconds > 0) {
printf("Date1 > Date2\n");
}
return 0;
}
If your dates are not of type time_t
, you can use the function mktime to convert them.