[syslog-ng]ISODATE offset?

Balazs Scheidler syslog-ng@lists.balabit.hu
Fri, 05 Nov 2004 12:49:28 +0100


On Fri, 2004-11-05 at 04:24, scott wrote:
> syslog-ng is recording the date as
> 
>  > 2004-11-05T14:21:17+1000
> 
> Which is wrong; it should be
> 
>  > 2004-11-05T14:21:37+1100
> 
> as `date --iso-8601` returns.
> 
> What gives?

Hmm.. your system-wide timezone setting might have problems. what
platform are you using? syslog-ng uses the following function to
calculate the timezone offset:

static size_t
format_tzofs(char *dest, size_t left, struct tm *tm)
{
        size_t length;

#if HAVE_GLOBAL_TIMEZONE
        length = snprintf(dest, left - 1, "%c%02ld%02ld",
                          timezone > 0 ? '-' : '+',
                          (timezone < 0 ? -timezone : timezone) / 3600,
                          (timezone % 3600) / 60);
#else
        length = strftime(dest, left -1, "%z", tm);
#endif
        return length;
}

-- 
Bazsi