: >Hi:
: >
: >How does one obtain the current date and time on a UNIX system from inside a C
: >program ?
: >
: > gettimeofday(struct timeval *, struct timezone *);
: >
: >gives me the time since the start of the epoch. Is there a easier way to
: >obtain the current system time like date(1) does ?
: >
: >Thanks,
: >
: >-- Niranjan
: >
: If you are on a SVR4 system have a look at the ctime(3) manual page.
: This has all the routines to get the current date/time in a variety of
: formats.
: I don't know if this is available on other systems, but have a look for it
: anyway, you might be lucky.
: --
: Nigel Wade, System Administrator, Ionospheric Physics Group,
: University of Leicester, Leicester, LE1 7RH, UK
: Phone : +44 (0)116 2523568, Fax : +44 (0)116 2523555