/***************************************************************
*        name: thirtydaysago.c
*     version: 0.0
* description: date arithmetic in C
*    synopsis: n.a. -- disregards arguments to main ( )
*  created by: David Clement
*        date: ??-FEB-2004
* modified by:
*        date:
***************************************************************/
    #include <time.h>

    int main (int argc, char **argv)
    {
        char s[10];
        int l = 10;
        struct tm *t;
        time_t today;
        
        time (&today);
        t = localtime (&today);
        t->tm_mday -= 30;
        mktime (t);
        
        if (strftime (s, l, "%d%b%Y", t) ) {
            strupper (s);
            printf ("Hello world, thirty days ago was %s.\n", s);
        }
        return;
    }