From 791d177c7f6007d79d1418b30091d07d2de2c297 Mon Sep 17 00:00:00 2001 From: Gurvinder Singh Date: Mon, 13 Dec 2010 17:27:46 +0100 Subject: [PATCH] fixed the timestamp issue in http.log --- src/log-httplog.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/log-httplog.c b/src/log-httplog.c index 1aba336592..e60c813bad 100644 --- a/src/log-httplog.c +++ b/src/log-httplog.c @@ -98,13 +98,12 @@ typedef struct LogHttpLogThread_ { static void CreateTimeString (const struct timeval *ts, char *str, size_t size) { time_t time = ts->tv_sec; struct tm local_tm; - struct tm *t = gmtime_r(&time, &local_tm); + struct tm *t = (struct tm *)localtime_r(&time, &local_tm); uint32_t sec = ts->tv_sec % 86400; snprintf(str, size, "%02d/%02d/%02d-%02d:%02d:%02d.%06u", - t->tm_mon + 1, t->tm_mday, t->tm_year - 100, - sec / 3600, (sec % 3600) / 60, sec % 60, - (uint32_t) ts->tv_usec); + t->tm_mon + 1, t->tm_mday, t->tm_year + 1900, t->tm_hour, + t->tm_min, t->tm_sec, (uint32_t) ts->tv_usec); } TmEcode LogHttpLogIPv4(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq, PacketQueue *postpq)