From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f8c9b,2bae07f119608996,start X-Google-Attributes: gidf8c9b,public X-Google-Thread: 103376,b1850e397df49d95 X-Google-Attributes: gid103376,public From: "Norman H. Cohen" Subject: Leap seconds in Unix time (was: Re: How to convert an Fixed_Point to to an Integer ?) Date: 1996/12/27 Message-ID: <32C448F8.5E25@watson.ibm.com>#1/1 X-Deja-AN: 206276969 references: <01bbf058$cbdbf980$LocalHost@jerryware> <1996Dec23.072835.1@eisner> <01bbf179$0c4361e0$9b2d5c8b@jerryware> <01bbf24c$a8db4800$b72d5c8b@jerryware> <32C2A408.53B8@watson.ibm.com> <01bbf3d9$b7b0f120$f22d5c8b@jerryware> content-type: text/plain; charset=us-ascii organization: IBM Thomas J. Watson Research Center mime-version: 1.0 reply-to: ncohen@watson.ibm.com newsgroups: comp.lang.ada,comp.unix.questions x-mailer: Mozilla 3.0 (Win95; I) Date: 1996-12-27T00:00:00+00:00 List-Id: Jerry van Dijk wrote: > But on page 155 Stevens says: > > "struct tm { /* a broken down time */ > int tm_sec; /* Seconds after the minute: [0, 61] */ > ... > > The reason that seconds can be greater than 59 is to allow for leap > seconds." > > And as the DJGPP info documents this fields as [0, 60] I am reasonable > convinced that leaps are taken care of in both systems. If the mappings between "struct tm" times and seconds-since-epoch times are one-to-one, this suggests that the seconds-since-the-epoch calculations somehow account for all the leap seconds since the start of 1970. Since these leap seconds occur sporadically, based on empirical observations of the earth's rotation, computations of seconds-since-epoch from struct tm values or from the system clock, and computations of struct tm values from seconds-since-epoch values, would require a data base of the dates since 1970 on which there were leap seconds. Can anyone confirm whether this is, indeed, how things work? -- Norman H. Cohen mailto:ncohen@watson.ibm.com http://www.research.ibm.com/people/n/ncohen