This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Still not fixed...



I thought I posted this quite some time ago, but it evidentally never made
it through to the list (funny how a lot of thigns don't make it through
recently). Anyway, this is something plenty of people have reported before,
but have never gotten a reply to as far as I can tell.

There is no tm_zone member in the TM struct nor an external array tzname to
get the name of the timezone. Also, the return of the tm_gmtoff (or extern
long timezone) is REALLY off.. when running a program and converting the
seconds it returns to the number of hours, days, mins, etc, I get some
obscene result like 3000 days 17 hours .... etc... here's a snippet that
handles the gmt_offset stuff (the defines are checked by a configure
script.. and neither HAVE_TM_GMTOFF of HAVE_SYS_TM_GMTOFF are defined:

long
get_tz_offset()
{
/*
 * SunOS don't seem to have timezone as a "extern long", but as
 * a structure. This makes it very hard (at best) to check for,
 * therefor I'm checking for tm_gmtoff. --WF
 */
#if defined(HAVE_TM_GMTOFF) || defined(HAVE_SYS_TM_GMTOFF)
    time_t now;

    time(&now);
    return (localtime(&now)->tm_gmtoff);
#else
    extern long timezone;

    return timezone;
#endif
}

I've got the src with me (got tired of an error in this server I'm running
and decided to look at it), but can't find hide nor hair of it (then agian,
I'm not a Win32 programmer, just a wannabe).. any help on this matter is
GREATLY appreciated.

- Greg Neujahr


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]