Time/date manipulation

hey folks,
been awhile (actaully a long while) since i last touched C. And the 3 books i've read don't really have much about using time.h

Question:
How would i be able to assign a variable the value of the current date minus 2 mths, keeping in mind the yr.
IE. would like to see Nov.31/2001 not Nov.31/2002.

sounds simple enough, but i'm remembering that there's nothing "easy" with C.

thanks,
choice
:confused:

      struct timeval tv;
      struct timezone tz;
      struct tm *tm;
      gettimeofday(&tv, &tz);
      tm=localtime(&tv.tv_sec);
      for(n=0; n<2; n++)
            if(!tm->tm_mon--)
                   tm->tm_mon=11,
                   tm->tm_year--;
      fputs(asctime(tm), stdout);