[LEAPSECS] DNS examples

Clive D.W. Feather clive at davros.org
Fri Jan 23 10:33:52 EST 2015


Steffen Nurpmeso said:
>  |> Well.  PHK follows the IERS format which uses the 1st of the month
>  |> after the leap second, i.e., the second after the leap occurred.
>  |
>  |This is an implementation detail.  PHK???s choice is as good as the other.
> 
> And i disagree with that.  The ISO C(99) standard doesn't offer
> a JDN-TO-Gregorian and vice versa calculation.  There is the
> well-known algorithm from Communications of the ACM, Vol 6, No 8,
> but it is not in the standard.

Irrelevant. The C Standard, in general, holds only those facilities which
either can't be expressed in terms of the Standard language itself
(e.g. printf) or which are extremely common and therefore benefit from
having a standard name (e.g. strcpy).

Converting JDN to Gregorian fits into neither of these categories, so it
does not belong in the C Standard.

> So in order to calculate the
> actual date where the drift adjustment occurs you have to face
> a very elaborate conversion.

No, you need to use a library that's already been written to do the job.
Takes 10 seconds or so.

-- 
Clive D.W. Feather          | If you lie to the compiler,
Email: clive at davros.org     | it will get its revenge.
Web: http://www.davros.org  |   - Henry Spencer
Mobile: +44 7973 377646


More information about the LEAPSECS mailing list