@node gettimeofday, time @subheading Syntax @example #include int gettimeofday(struct timeval *tp, struct timezone *tzp); @end example @subheading Description Gets the current GMT time and the local timezone information. The return structures are as follows: @example struct timeval @{ long tv_sec; /* seconds since 00:00:00 GMT 1/1/1970 */ long tv_usec; /* microseconds */ @}; struct timezone @{ int tz_minuteswest; /* west of GMT */ int tz_dsttime; /* set if daylight saving time in affect */ @}; @end example If either @var{tp} or @var{tzp} are @code{NULL}, that information is not provided. Note that although this function returns microseconds for compatibility reasons, the values are precise to less than 1/20 of a second only. The underlying DOS function has 1/20 second granularity, as it is calculated from the 55 ms timer tick count, so you won't get better than that with gettimeofday(). @xref{settimeofday}. @subheading Return Value Zero on success, nonzero on failure. @subheading Portability @portability !ansi, !posix