Re: wrong timestamps

2005-07-20 Thread Alain Guibert
On Tuesday, July 5, 2005 at 6:59:04 PM +0200, Hrvoje Niksic wrote: Am I completely off the mark, or can mktime_from_utc (or in fact timegm) be replaced by something as simple as the following? Or is it too good to be true? It returns a number of seconds since epoch neglecting leap seconds.

Re: wrong timestamps

2005-07-05 Thread Hrvoje Niksic
Alain Guibert [EMAIL PROTECTED] writes: (1) Libc 5.4.33 own mktime() produces wrong by some minutes results for all summer dates when tm_isdst is forced to false 0. Wget's mktime_from_utc() forces tm_isdst=0 at a stage, and produces wrong by some minutes result only for one hour, beginning at

Re: wrong timestamps

2005-05-19 Thread Alain Guibert
On Saturday, May 14, 2005 at 10:09:32 PM +0200, Hrvoje Niksic wrote: Alain Guibert [EMAIL PROTECTED] writes: Maybe cmpt.c mktime is failing because of incompatible timezone and daylight infos on the platform? If you change __tzset() to tzset() and remove the surrounding #ifdef _LIBC, does

Re: wrong timestamps

2005-05-19 Thread Hrvoje Niksic
Alain Guibert [EMAIL PROTECTED] writes: On Saturday, May 14, 2005 at 10:09:32 PM +0200, Hrvoje Niksic wrote: Alain Guibert [EMAIL PROTECTED] writes: Maybe cmpt.c mktime is failing because of incompatible timezone and daylight infos on the platform? If you change __tzset() to tzset() and

Re: wrong timestamps

2005-05-19 Thread Roger L. Beeman
I have been trying to follow this thread, but have not yet devoted enough time to fully understand the issues, so I would very much appreciate the summary. The [EMAIL PROTECTED] address is no longer valid, but I am subscribed to the list. Edward Sabol was an integral contributer to the current

Re: wrong timestamps

2005-05-19 Thread Alain Guibert
On Thursday, May 19, 2005 at 3:24:39 PM +0200, Hrvoje Niksic wrote: * Is GMT0 a portable value for TZ? TZ=GMT0 works on Linux libc5/Glibc, Cygwin, and MinGW. setenv is not available on Windows, or at least Borland's headers don't include a prototype. (But they do include putenv.)

Re: wrong timestamps

2005-05-19 Thread Alain Guibert
Hello Roger, On Thursday, May 19, 2005 at 8:09:51 AM -0700, Roger L. Beeman wrote: I have been trying to follow this thread, but have not yet devoted enough time to fully understand the issues, so I would very much appreciate the summary. The [EMAIL PROTECTED] address is no longer valid,

Re: wrong timestamps

2005-05-14 Thread Alain Guibert
On Monday, May 9, 2005 at 5:53:26 PM +0200, Hrvoje Niksic wrote: Alain Guibert [EMAIL PROTECTED] writes: What about another method: putenv(TZ=GMT0), tzset(), mktime(), reset TZ to previous state, tzset() again. Not portable? That sounds at least as non-portable as the current method, and it

Re: wrong timestamps

2005-05-14 Thread Hrvoje Niksic
Alain Guibert [EMAIL PROTECTED] writes: I find it strange that the cmpt.c mktime produces garbage when that version is taken from glibc. Note that with TZ=GMT0 method and #undef HAVE_MKTIME, wget gives correct timestamps. Maybe cmpt.c mktime is failing because of incompatible timezone and

Re: wrong timestamps

2005-05-09 Thread Alain Guibert
On Saturday, May 7, 2005 at 6:56:53 PM +0200, Hrvoje Niksic wrote: I was lead to believe that it is quite reasonable to set tm_isdst to zero before calling mktime. In fact, the logic in mktime_from_utc, along with setting tm_isdst to zero, was explicitly written to support discontinuities at

Re: wrong timestamps

2005-05-09 Thread Hrvoje Niksic
Alain Guibert [EMAIL PROTECTED] writes: On Saturday, May 7, 2005 at 6:56:53 PM +0200, Hrvoje Niksic wrote: I was lead to believe that it is quite reasonable to set tm_isdst to zero before calling mktime. In fact, the logic in mktime_from_utc, along with setting tm_isdst to zero, was

Re: wrong timestamps

2005-05-07 Thread Hrvoje Niksic
Alain Guibert [EMAIL PROTECTED] writes: No such problem with Woody and Glibc. This problem seems to be half Wget half libc 5.4.33. In src/http.c:mktime_from_utc() and http_atotm(), Wget manipulates tm structs forcing tm_isdst to 0. Which is false 7 monthes a year, and hurts libc mktime()