Subj : Re: 'Leap Second' to Be Added on New Year's Eve This Year
To : All
From :
[email protected]
Date : Sat Dec 31 2016 02:20 pm
Subject: Re: 'Leap Second' to Be Added on New Year's Eve This Year
From: Mark Lloyd <
[email protected]>
On 12/30/2016 07:48 PM, Keith Thompson wrote:
[snip]
> 64-bit systems already use a 64-bit signed integer for time_t, which
> postpones the problem for about 292 billion years. And since C requires
> long long to be at least 64 bits, I expect that 32-bit systems (and
> smaller ones, if any) will transition to 64-bit time_t before 2038.
Most will, I now expect few Y2.038K problems.
> Unlike 2-digit years, I suspect that most stored time_t values (which
> are rarely displayed) are in files that can be converted reasonably
> easily.
>
I have some code on my website that stores times as decimal numerals.
Until 2038, a 64-bit time_t stores exactly the same thing as a 32-bit
time_t. There was no problem converting THAT to 64-bit. The only thing
that changed was code to handle dates outside of the 32-bit range (which
had been stored as julian dates).
Since I want to see what my computer does with the leap second, so I
have written this short PHP script (runs standalone, not as a webpage)
that prints the GMT time every second until 10 seconds into the new year.
------------------------------------------------------------------------
<?php
for ($i = 0; $i < gmmktime(0,0,10,1,1,2017); $i++) {
print gmdate('r') . "\n";
usleep(999900);
}
?>
--------------------------------------------------------------------------
If you want to use it, you have less than 4 hours to get it going. It
stops just after midnight so you can see the important part.
--
Mark Lloyd
http://notstupid.us/
"Call on God, but row away from the rocks." [Indian proverb]
--- ViaMAIL!/WC v2.00
* Origin: ViaMAIL! - Lightning Fast Mailer for Wildcat! (1:261/20)