Time in c

quite simply I need to get the local system time, make a variable out of it and insert it into a output file
I just cant figure out how to do this.. :confused: :confused: please someone help

as long as it is in a format
theCurrentDate = dd/MMM/YYYY
theCurrentTime = hh:mm

---------------
useless info
---------------

where
dd is the day of the month ie 13
MMM is the first 3 char's of the month ie. MAR
YYYY is the year ie 2002

hh is the hour of the day (in 24 hour format) ie. 14
and
mm is the minutes of the hour ie. 30

Read the man page to "date".
It may actaully even give you example of how to do this.

For example:
date "+%H:%M"

and how would I use that in a c program?
sorry I'm really REALLY new to programming in c

#include <sys/time.h>
#include <stdio.h>

main()
{
        struct timeval tv;
        struct timezone tz;
        struct tm *tm;
        char buff[100];
        gettimeofday(&tv, &tz);
        tm=localtime(&tv.tv_sec);
        strftime(buff, sizeof buff, "%d/%h/%Y %H:%M", tm);

        fputs(buff, stdout);
        putc('\n', stdout);
        exit(0);
}