[RESENT] TIME_GetBias

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Tue Mar 16 13:12:50 CST 2004


>>>>> "Alexandre" == Alexandre Julliard <julliard at winehq.org> writes:

    Alexandre> Uwe Bonnes <bon at elektron.ikp.physik.tu-darmstadt.de> writes:
    >> Changelog: wine/dlls/ntdll/time.c: TIME_GetBias Calculate the Bias
    >> before calling gmtime

    Alexandre> This cannot be right, the bias is supposed to be the
    Alexandre> difference between local time and GMT, so you have to use
    Alexandre> gmtime() not localtime().

Look for the typical sequence:

... RtlLocalTimeToSystemTime ()
...
    gmt = time(NULL);
    bias = TIME_GetBias(gmt, &daylight);

TIME_GetBias(time_t utc, int *pdaylight)
    ...
    ptm = localtime(&utc);
    ptm = gmtime(&utc);
    ret = last_bias = (int)(utc-mktime(ptm));

I my understanding mktime(gmtime(time(NULL))) == time(NULL)


-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------



More information about the wine-devel mailing list