Linux "date" command ignores leap-seconds?

Bill Duncan bduncan-m0FWaBiyNdxg9hUCZPvPmw at public.gmane.org
Mon Jan 14 23:10:43 UTC 2013


The whole point I believe, is to insert them in there *without* accounting
for it.  If you think about it, if the userland programs added the seconds
in there, then you wouldn't have accomplished anything.  eg.  43years + N
seconds would still be just that..  43 years + N seconds.

The leap seconds are "inserterted" while clocks are effectively standing
still for an extra second, so date and their userland ilk will not know
about it..

Cheers.

[William Porquet said:]
> 
> IIRC, leap-seconds are added as needed by an independent origanization
> to account for the slight lag of the earth's rotation around the sun.
> 
> http://en.wikipedia.org/wiki/Leap-second#Insertion_of_leap_seconds
> 
> Cheers,
> W.
> 
> On 14 January 2013 17:23, Lennart Sorensen <lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org> w=
> rote:
> > On Mon, Jan 14, 2013 at 05:19:15PM -0500, Walter Dnes wrote:
> >>   I'm not complaining, because I prefer it that way, but I just want to
> >> check.  First, let's get the number of seconds between 1970/01/01 and
> >> 2013/01/01, i.e. exactly 43 years.
> >>
> >> [d531][waltdnes][~] date +%s -u -d 2013-01-01
> >> 1356998400
> >>
> >>   Next, divide by 86,400 (number of seconds in a day.
> >>
> >> [d531][waltdnes][~] echo $(( 1356998400 / 86400 ))
> >> 15706
> >>
> >>   And confirm that this is an exact division with zero remainder.
> >>
> >> [d531][waltdnes][~] echo $(( 15706 * 86400 ))
> >> 1356998400
> >>
> >>   Divide 15706 days by 365
> >>
> >> [d531][waltdnes][~] echo $(( 15706 / 365 ))
> >> 43
> >>
> >>   Multiply by 365 to check the remainder
> >>
> >> [d531][waltdnes][~] echo $(( 43 * 365 ))
> >> 15695
> >>
> >>   15706 - 15695 =3D 11.  This is due to 11 intervening leap years, i.e.
> >> 1972, 1976, 1980, 1984, 1988, 1992, 1996, 2000, 2004, 2008, and 2012.
> >>
> >>   So it all works out.  Is this supposed to continue, or are there any
> >> plans to include leap seconds?  Right now, I'd prefer not to.
> >
> > I do not believe information on leap seconds is part of the timezone data=
> ,
> > so there is nowhere to get this information from as far as I know.
> >
> > I think leap seconds are just to keep midnight at midnight and the
> > historical effect of them is so small as to be generally irrelevant and
> > is hence ignored.
> >
> > --
> > Len Sorensen
> > --
> > The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> > TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> > How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
> 
> 
> 
> --=20
> William Porquet, M.A. =E2=98=A8 mailto:william-HPpJ5Ac2/Hg at public.gmane.org =E2=98=A8 http://ww=
> w.2038.org/
> =E2=80=9CLuck is what happens when preparation meets opportunity.=E2=80=9D =
> - Lucius
> Ann=C3=A6us Seneca
> --
> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
> 


-- 
Bill Duncan,
bduncan-m0FWaBiyNdxg9hUCZPvPmw at public.gmane.org
+1 416 697-9315
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list