Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   Strange problem with dates - need debugging help, posted by T. Ribbrock on Fri Feb 4 00:11:09 2011 
    icon2.gif   Re: Strange problem with dates - need debugging help, posted by Stefan Ritt on Fri Feb 4 10:20:12 2011 
       icon14.gif   Re: Strange problem with dates - need debugging help, posted by T. Ribbrock on Fri Feb 4 11:52:45 2011 
Message ID: 67007     Entry time: Fri Feb 4 10:20:12 2011     In reply to: 67006     Reply to this: 67008
Icon: Reply  Author: Stefan Ritt  Author Email: stefan.ritt@psi.ch 
Category: Question  OS: Other  ELOG Version: 2.8.1 
Subject: Re: Strange problem with dates - need debugging help 

T. Ribbrock wrote:

I have just installed elog 2.8.1 on my OpenBSD 4.8 server (I've added the necessary Makefile patch to "Contributions"). Everything seems to work fine, however, I ran into a very odd problems with the dates of the logbook entries: When I start a new entry, the current date/time is displayed correctly. When I submit the entry and look at it again, the date has changed to some value in 1996 . I've checked the actual logbook file and there, the entry has a Date line like this:

Date: Thu, 03 Feb 2011 23:53:28 -13049141
 

The "-13049141" looks very suspicious to me - but I have no idea whatsoever why this happens. I had elogd running with -v, but that did not give me any hints. Any ideas how to debug/resolve this would be much appreciated... 

The problem is most probably related to the time zone. elogd contains a function:


/* workaround for wong timezone under MAX OSX */
long my_timezone()
{
#if defined(OS_MACOSX) || defined(__FreeBSD__)
   time_t tp;
   time(&tp);
   return -localtime(&tp)->tm_gmtoff;
#else
   return timezone;
#endif
}
 
from which you can see that there is a different behavior between different Linux flavors and OSX/FreeBSD. Maybe you need an additional
 
|| defined(__OpenBSD__)
 
if the pre-compiler directive __FreeBSD__ is not defined on your system. The result of the function should be the time zone in seconds relative to GMT. So for central Europe, it should give "-3600".
 
Let me know if you find something out, I can then include it in the distribution.
 
Best regards,
 
  Stefan
ELOG V3.1.5-fe60aaf