log file timestamp

Igor Sysoev is at rambler-co.ru
Thu Jun 19 16:52:46 MSD 2008


On Thu, Jun 19, 2008 at 08:08:32AM -0400, J Davis wrote:

> checking for struct tm.tm_gmtoff ... found

Well, could you built a new program below and run it with date's again ?

-----------
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif

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

int
main()
{
    time_t      s;
    struct tm   t;

    tzset();

    s = time(NULL);

    (void) localtime_r(&s, &t);

    printf("%02d:%02d %d %d\n", t.tm_hour, t.tm_min, t.tm_isdst, t.tm_gmtoff);

    return 0;
}
-----------


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list