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: List-Archive: List-Post: List-Help: , Delivered-To: mailing list cygwin-apps AT sources DOT redhat DOT com Message-ID: <018301c0c619$45c90d60$0200a8c0@lifelesswks> From: "Robert Collins" To: 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 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit 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" To: Cc: 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 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