Artur Zaprzala <[EMAIL PROTECTED]> writes:

> This patch contains even more simple solution.

It is *always* a good idea to check with the latest CVS sources before
sending a patch.  mktime_from_utc has been rewritten and should now
work correctly with DST.

>  static time_t
>  mktime_from_utc (struct tm *t)
>  {
> -  time_t tl, tb;
> -
> -  tl = mktime (t);
> -  if (tl == -1)
> -    return -1;
> -  tb = mktime (gmtime (&tl));
> -  return (tl <= tb ? (tl + (tl - tb)) : (tl - (tb - tl)));
> +  time_t tt = mktime(t);
> +  if (tt == -1) return -1;
> +  return tt-timezone;        /* mktime assumes localtime, so we need to adjust */
>  }

Where does `timezone' come from?

Reply via email to