comp.lang.ada
 help / color / mirror / Atom feed
From: "Norman H. Cohen" <ncohen@watson.ibm.com>
Subject: Leap seconds in Unix time (was: Re: How to convert an Fixed_Point to to an Integer ?)
Date: 1996/12/27
Date: 1996-12-27T00:00:00+00:00	[thread overview]
Message-ID: <32C448F8.5E25@watson.ibm.com> (raw)
In-Reply-To: 01bbf3d9$b7b0f120$f22d5c8b@jerryware


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




  reply	other threads:[~1996-12-27  0:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-12-22  0:00 How to convert an Fixed_Point to to an Integer ? Jerry van Dijk
1996-12-23  0:00 ` Eric Miller
1996-12-23  0:00 ` Jerry van Dijk
1996-12-23  0:00 ` Larry Kilgallen
1996-12-23  0:00   ` Robert Dewar
1996-12-24  0:00     ` Jerry van Dijk
1996-12-24  0:00       ` Robert Dewar
1996-12-24  0:00         ` Norman H. Cohen
1996-12-24  0:00           ` Robert Dewar
1996-12-26  0:00             ` Keith Thompson
1996-12-26  0:00               ` Robert Dewar
1996-12-25  0:00         ` Jerry van Dijk
1996-12-25  0:00           ` Robert Dewar
1996-12-26  0:00             ` Norman H. Cohen
1996-12-27  0:00               ` Jerry van Dijk
1996-12-27  0:00                 ` Norman H. Cohen [this message]
1996-12-30  0:00               ` Mike Young
1996-12-30  0:00                 ` 2000 is a leap year (was: How to convert an Fixed_Point to to an Inte) Larry Kilgallen
1996-12-30  0:00                 ` How to convert an Fixed_Point to to an Integer ? Michael F Brenner
1996-12-31  0:00                 ` Keith Thompson
1997-01-02  0:00             ` 2000 is a leap year (was: How to convert an Fixed_Point to to an Inte) Mike Paley
1996-12-30  0:00 ` How to convert an Fixed_Point to to an Integer ? Steve Jones - JON
1996-12-30  0:00   ` Jacques Rouillard
1996-12-30  0:00 ` Steve Jones - JON
1996-12-30  0:00 ` Dave Barnes
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox