Re: [Evolution] Strange Time Problem



Build the attached program with:

gcc -Wall -o timezone timezone.c -DHAVE_TIMEZONE

then do ./timezone

Are the results correct? If not, then your system is misconfigured.

Jeff

On Sat, 2003-01-25 at 19:18, Bill Hartwell wrote:
I just happened to catch this while sitting at my computer checking
mail. Four minutes ago (5:04pm, my time), Evolution's date display
flicked over to tomorrow's date. That would be correct - if I were on
GMT. But I keep both my software clock and my hardware clock on local
time (US-MST, -7).

Any ideas why Evolution is 7 hours ahead of my system clock?
-- 
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj ximian com  - www.ximian.com
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <stdio.h>
#include <string.h>
#include <time.h>

int main (int argc, char **argv)
{
        char tzone[10];
        struct tm *tm;
        time_t now;
        
        time (&now);
        tm = localtime (&now);
        
        strftime (tzone, 10, "%Z", tm);
        
#ifdef HAVE_TIMEZONE
        printf ("Your current timezone is %.4ld (%s)\n",
                -1 * (((timezone / 60 / 60) - daylight) * 100), tzone);
#elif HAVE_TM_GMTOFF
        printf ("Your current timezone is %.4ld (%s)\n",
                tm.tm_gmtoff, tzone);
#else
#error Neither HAVE_TIMEZONE nor HAVE_TM_GMTOFF are defined.
#endif
        
        return 0;
}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]