delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-apps/2001/04/15/22:02:19

Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com
List-Subscribe: <mailto:cygwin-apps-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-apps/>
List-Post: <mailto:cygwin-apps AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-apps-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/lists.html#faqs>
Delivered-To: mailing list cygwin-apps AT sources DOT redhat DOT com
Message-ID: <018301c0c619$45c90d60$0200a8c0@lifelesswks>
From: "Robert Collins" <robert DOT collins AT itdomain DOT com DOT au>
To: <cygwin-apps AT sources DOT redhat DOT com>
References: <017501c0c618$a9934690$0200a8c0 AT lifelesswks> <200104160200 DOT WAA05740 AT envy DOT delorie DOT com>
Subject: Re: I'm working on libgcj...
Date: Mon, 16 Apr 2001 12:02:19 +1000
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
X-OriginalArrivalTime: 16 Apr 2001 01:55:02.0649 (UTC) FILETIME=[404A2690:01C0C618]

----- Original Message -----
From: "DJ Delorie" <dj AT delorie DOT com>
To: <robert DOT collins AT itdomain DOT com DOT au>
Cc: <cygwin-apps AT sources DOT redhat DOT com>
Sent: Monday, April 16, 2001 12:00 PM
Subject: Re: I'm working on libgcj...


>
> > What spec is timezone() derived from?
>
> Timezone is one of those "traditionally different" things.  I don't
> recall exactly which OS defined it the cygwin way, but it's not
> uncommon to define it that way.
>

Thanks. The bit of code I'm fighting with is

#ifdef STRUCT_TM_HAS_GMTOFF
  tzoffset = -(tim->tm_gmtoff); // tm_gmtoff is secs EAST of UTC.
#elif HAVE_TIMEZONE
  tzoffset = timezone;          // timezone is secs WEST of UTC.
#else
  // FIXME: there must be another global if neither tm_gmtoff nor
timezone
  // is available, esp. if tzname is valid.
  // Richard Earnshaw <rearnsha AT arm DOT com> has suggested using difftime to
  // calculate between gmtime and localtime (and accounting for possible
  // daylight savings time) as an alternative.  Also note that this same
  // issue exists in java/util/natGregorianCalendar.cc.
  tzoffset = 0L;
#endif

And I was hoping to avoid putting a #ifdef __CYGWIN__ in there. I
presume the long term fix is to add tm_gmtoff to the timezone struct?

Rob

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019