From ajosey@tamarix.rdg.opengroup.org Wed Feb 17 12:42:11 1999 Received: from mailgate.rdg.opengroup.org (mailgate.rdg.opengroup.org [192.153.166.4]) by dkuug.dk (8.8.7/8.8.7) with SMTP id MAA11866 for ; Wed, 17 Feb 1999 12:42:11 +0100 (CET) (envelope-from ajosey@tamarix.rdg.opengroup.org) Received: by mailgate.rdg.opengroup.org; id AA30348; Wed, 17 Feb 1999 11:43:11 GMT Received: from tamarix.rdg.opengroup.org [192.153.166.189] by mailgate.rdg.opengroup.org via smtpd V1.26 (98/11/23 13:59:56) for ; Wed Feb 17 11:43 GMT 1999 Received: (from ajosey@localhost) by tamarix.rdg.opengroup.org (8.8.7/8.8.7) id LAA03903; Wed, 17 Feb 1999 11:37:17 GMT Date: Wed, 17 Feb 1999 11:37:17 GMT From: Andrew Josey Message-Id: <990217113716.ZM3902@tamarix.rdg.opengroup.org> Reply-To: ajosey@rdg.opengroup.org (Andrew Josey) X-Mailer: Z-Mail (5.0.0 30July97) To: gwc@root.co.uk Subject: Finalised PASC 1003.1 Interpretation #92 Cc: stds-pasc-ieee-officers@ieee.org, sc22wg15@dkuug.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: Geoff Clare From: Andrew Josey, PASC Interpretations Functional Chair Reference: PASC 1003.1-90 #92 Dear Mr. Clare Subject: IEEE Standard 1003.1-1990 Enclosed is the official response for your request for an interpretation of IEEE Standard 1003.1-1990. This response was developed and approved by the members of the 1003.1 Interpretations Committee. To obtain an understanding of the PASC Guidelines for interpretations and their classifications please read http://www.pasc.org/interps/ Please can you confirm receipt of this electronic mail message within ten working days, please carbon copy your response to the IEEE (stds-pasc-ieee-officers@ieee.org) Sincerely, Andrew Josey PASC Functional Chair Interpretations Enclosures Cc: IEEE PASC Officers, SC22 WG15 _____________________________________________________________________________ PASC Interpretation reference 1003.1-96 #92 _____________________________________________________________________________ Interpretation Number: XXXX Topic: Seconds since the epoch Relevant Sections: p25, ll 497-498, clause 2.2.2.113 PASC Interpretation Request: ---------------------------- Date: Fri, 17 Jul 1998 17:16:25 +0100 From: XXXXXXXXXXXXXXXXXXXXXXXXX ------------------------------------------------------------------------ 7 Defect Report concerning (number and title of International Standard or DIS final text, if applicable): IEEE Std 1003.1-1996 (incorporates 1003.1-1990, 1003.1b-1993, 1003.1c-1995, 1003.1i-1995) (ISO 9945-1:1996) ------------------------------------------------------------------------ 8 Qualifier (e.g. error, omission, clarification required): 1 Error=1 , Omission=2, Clarification=3 ------------------------------------------------------------------------ 9 References in document (e.g. page, clause, figure, and/or table numbers): p25, ll 497-498, clause 2.2.2.113 ------------------------------------------------------------------------ 10 Nature of defect (complete, concise explanation of the perceived problem): IEEE Std 1003.1-1996 contains an error in section 2.2.2.113 which defines the term "seconds since the Epoch". The error is that the expression: tm_sec + tm_min*60 + tm_hour*3600 + tm_yday*86400 + (tm_year-70)*31536000 + ((tm_year-69)/4)*86400 does not correctly account for leap years. It adds one day for every four years, thus disregarding the rule that years divisible by 100 are only leap years if also divisible by 400. The expression produces incorrect values for years 2101 onwards, and so the error could perhaps be called a "Year 2101 bug". Of course, this does not affect implementations with a (signed) 32-bit time_t, which can only represent years up to 2038, and this probably explains why the necessary extra parts of the expression were omitted in the original 1988 standard. ------------------------------------------------------------------------ 11 Solution proposed by the submitter (optional): I believe a suitable correction is as follows: tm_sec + tm_min*60 + tm_hour*3600 + tm_yday*86400 + (tm_year-70)*31536000 + ((tm_year-69)/4 - (tm_year-1)/100 + (tm_year+299)/400)*86400 ------------------------------------------------------------------------ Interpretation response: ----------------------- The standards states the requirements for seconds since the eopch , and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor. Rationale ------------- None. Notes to the technical editor (not part of this interpretation) ----------------------------- The proposed correction in section 11 should be considered for a future revision. Forwarded to Interpretations group: 22 July 1998 Proposed Interpretation: 10 August 1998 Finalised: February 17 1999