#include <time.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/timeb.h>
#include <string.h>
int main()
{
struct tm tm1;
tm1.tm_mon=10-1;
tm1.tm_mday=24;
tm1.tm_year=1994-1900;
tm1.tm_hour=tm1.tm_min=tm1.tm_sec=0;
tm1.tm_isdst=-1;
printf("%d/%d/%d\n",tm1.tm_mon,tm1.tm_mday,tm1.tm_year);
tm1.tm_mday+=90;
if(mktime(&tm1)==-1)
{
fprintf(stderr,"mktime failed \n");
}else{
printf("%d/%d/%d\n",tm1.tm_mon+1,tm1.tm_mday,tm1.tm_year+1900);
}
}
Output
9/24/94
1/22/1995