Leap Second Coming In June, 2012
Zoxed writes "IERS have just announced a leap second due at midnight, June 30th this year. Are your systems ready?" The last leap second added was at the end of 2008.
← Back to Stories (view on slashdot.org)
The *LAST* leap second occured in 2012
I demand at least 3^10x8 seconds advance warning.
When the foot seeks the place of the head, the line is crossed. Know your place. Keep your place. Be a shoe.
I use NTP on my systems!
They fix the timers, I got mine fixed. Automagically!
Sent as ripples into the electromagnetic field. No single photon has been harmed in the process.
Of course! My systems are second-to-none. You should see what it clocks in at - not exactly a minute set of figures! That's if you have the time..
I think that would double every second for the entire day. Be more specific.
"Here Lies Philip J. Fry, named for his uncle, to carry on his spirit"
$sec = $sec + (($mon==5) && ($mday = 30));
One small step for man; one leap second for computer systems?
php coders. pah.
Not only that, but this bug would kick in every year on June 30.
Also... why the else clause? A good compiler will *probably*... no make that *hopefully* optimize that away...
Christ that guy sucks!
On 5, 10, 15 or 20 MHz: at 00:00Z you will hear minute consisting of 61 seconds.
If you happen to have a radio controlled timepiece, this will also be your chance to see if they handle the leap second conversion or took the lazy way out and just rely on the next time sync fix the time.
00:00UTC June 30th 2012 is a Saturday evening in North America. What better way to celebrate a Saturday night?
Well, I think we now have a good example of how NOT to code.
I am very small, utmostly microscopic.
Ugh. You have reminded me why I left Perl behind for a language that has strict typing.
"Please describe the scientific nature of the 'whammy'" - Agent Scully
And in 2013.... (and 2014, and 2015, and 2016....)?
I am very small, utmostly microscopic.
php scripters. pah.
FTFY
Has NOTHING AT ALL to do with the US government. Pah !
Religous speak to God. Insane are spoken to by God. When all shut up, one can finally hear Shostakovich in peace
Wait a minute. Isn't this the code that documents itself?
I choose friends for sigs
Leap seconds are a tiny bit of problem when you have to time-stamp transactions coming in from all over the globe and keep them in date/time order. Some OSes don't support leap seconds, which complicates matters. We have the procedures documented from the last time this happened in 2008, but, of course, we've changed OS, DB and message queue vendors since then, so nothing applies anymore.
Time to spin up a new project and pay some high-priced consultants a lot of money to rewrite the procedures documentation yet again. I suspect we'll take the coward's way out and shut down processing for a minute before until a minute after and resync the clocks in the interim.
That will, of course, be charged to our SLA downtime, which will affect everyone's performance reviews at the end of the year. All this for a single goddamn second.
- Pithy comment goes here.
Not only that, but this bug would kick in every year on June 30.
Also... why the else clause? A good compiler will *probably*... no make that *hopefully* optimize that away...
Christ that guy sucks!
I saw that too, then I thought, "It's Perl, do I really think that I know what it does?"
Hmm perhaps there are these things "things" such as computers, atomic clocks, disciplined oscillators, what have you, that simply do not jibe with Pope Gregory's calendar?
Just maybe?
Oh for fucks sake why did I even reply?
I am very small, utmostly microscopic.
"Officer. The reason I was driving so fast is that I was trying to adjust my watch using relativistic time dilation."
Have gnu, will travel.
Lost an equal sign there; your code is incrementing every day in month 5 (and also every year).
I need a lot more warning than this! We won't even be able to have the meeting in time to decide who to invite to the pre-project inception meeting.
I want a list of atrocities done in your name - Recoil
That's because the perl interpreter sends each script to Larry Wall for review and correction.
Such a pity you didn't invest that extra second in checking your spelling and grammar. =p
will be screwed
It's hard to believe that's how Micronians are made. Why don't we see it right now by having you both kiss one another?
Oh for fucks sake why did I even reply?
I thought the same thing, after seeing that the 1-level-up post came from an AC. SIGH
Religous speak to God. Insane are spoken to by God. When all shut up, one can finally hear Shostakovich in peace
Two days ago there were several articles stating that leap second might be abolished: http://www.scientificamerican.com/podcast/episode.cfm?id=leap-seconds-may-disappear-12-01-02 "This month the International Telecommunication Union will consider a proposal to abolish leap seconds."
Yes!! An extra second for drinking.
Who is this "Leap"? Why is his second coming so important?
Don't make the mistake of assuming this code runs forever in a loop.
Hey, did you think gettimeofday returned the number of seconds since the epoch? That a call to gettimeofday would return a value >= to the last call? Well, it doesn't, because it's based on UTC, which is defined as seconds since the epoch, minus leaps seconds.
As a result, a value returned by gettimeofday does not refer 1:1 to a point in time, and the clock will skip a second backwards at random moments (leap seconds happen when IERS says so).
I mean, you could put the leap second logic in the same place timevals are converted to a user-displayable format, like timezones, DST and, i don't know, leap YEARS, but NO, lets be absolutely retarded and break every program in the world that dares to make the assumption that time moves forward. There is also no other way to get the unix time.
Most people don't even know about it, which results in bugs (there was a story about that earlier), but honestly, I consider the systems that work like this broken and not the applications.
Well, it is going to have to run at least once a day in order to work.
Which means once a day every year it is going to fuck up.
I am very small, utmostly microscopic.
Looks like May 30th to my human brain... Who's got the brain that came up with the idea of having months start at zero, but day of month start at one?!?!
Is that ((leap second) coming) or (leap (second coming))?
There's a significant difference!
I'm old enough to remember when discussions on Slashdot were well informed.
I accept your chiding, but don't let it rise to actual criticism. Humorous pedantry is one thing, but you don't have enough information for real pedantry. For instance, without seeing the whole program, you don't know whether the immediate previous line of code was
if($year==2012) {
You also don't know if this is code only run during May, June, July, August, and September of 2012, as a special process. So again, ha ha, I laugh with you for ways to make jokes about silly tidbits of code posted to an unimportant story on Slashdot, but the criticism isn't capital-V Valid.
OpenNTPD just ignored the leap second
OpenNTPD has clearly been written by someone who doesn't understand NTP. For example, it advertises incorrect root delay and disperson values, which can cause clients to fail to achieve a majority vote, or to pick the wrong peer to synchronise against. (Earlier versions were even worse, they advertised themselves as being at stratum 0, which could cause synchronisation loops; this has thankfully been fixed, but it doesn't inspire much confidence in the authors' competence.)
I've also found OpenNTP to fail to regulate the local clock on dodgy hardware (it would oscillate wildly, with an amplitude of 3 seconds or so), in situations where the reference ntpd coped just fine.
Folks, do yourself and everyone a favour -- run the reference NTP, run chrony, heck, run some SNTP client, but please avoid OpenNTPD.
Replying to undo mod - tried to do "funny" but saw some paultard had already done "insightful". WTF!
Watch this Heartland Institute video
wat, no luv for Gene Ray all up in this thread?!!! For shame.
I never did understand what irradiating genetic material had to do with the natural timeframe of reality, but then, I'm not one of dem there big brains with a website on teh intarwebs.
the preceding comment is my own and in no way reflects the opinion of the Joint Chiefs of Staff
Ugh. You have reminded me why I left Perl behind for a language that has strict typing.
umm you mean ?
sec += ((mon == 5 && mday == 30 && hour ==0 && min == 0 && sec == 0 year == leapyear) ? 2 : 1);
Still, that is pretty ugly but at least it works. Other wise time will only advance by 1 second every 4 years!
A loop, by its nature, continues. If that didn't make sense, start reading this sentence again.
Also... why the else clause? A good compiler will *probably*... no make that *hopefully* optimize that away...
PHP is not compiled! But that code won't be run anyway, it is just taking up 21 bytes of RAM but no cycles.
It is dangerous to be right when the government is wrong.
Hmmm, mildly clever troll? Or just further proof that Ron Paul is supported by really stupid people?
Poe's law strikes again. (My vote is that the answer to the first question is "yes".)
Who's got the brain that came up with the idea of having months start at zero, but day of month start at one?!?!
The same guy who decided that C arrays start at 0 instead of 1.
One of the common, if not most common, use of the month number is to look up the month name in an array so the human used is told "June" instead of "5".
Which reminds me of my wonderful Cruz book reader, running android, which has no ability to look up the month name from the number outside the full calendar app. When I set the alarm clock, the "repeat" shows, for my weekday alarm, "8:30 on 2,3,4,5,6".
It took me a few seconds to figure out the title. At first I thought we were supposed to jump for joy that Jesus was making a comeback in June. Oh I don't know...which is more exciting?
http://www.acetonestudio.com
Yes, indeed. The gettimeofday() function should be used only when you need the time of day.
So what do I use if I need the time of day in UTC as specified by ITU-R TF.460-6? I.e., what do I use to get the time of day in a form such that
applies, complete with the clock going from 23:59:59 to 23:59:60 to 00:00:00 the next day when a positive leap second occurs and going from 23:59:58 to 00:00:00 the next day when a negative leap second occurs?
Hint: the answer does not involve using any API in the Single UNIX Specification. The answer might involve a combination of an API that returns a count of elapsed seconds of real time since January 1, 1970, 00:00:00 UTC - which is NOT the same as "Seconds Since the Epoch" as defined in the Single UNIX Specification, as the latter doesn't just count seconds over leap seconds - and an API that acts like the gmtime() in the Olson sample code when used with an Olson database file that includes leap seconds.
(Note that the formula in the Single UNIX Specification's definition of "Seconds Since the Epoch" - section 4.15 in "Base Definitions" in the current version of the SUS - can give the same value for "Seconds Since the Epoch" for two different "Coordinated Universal Time names"; the formula
will give the same value for XXXX-XX-XX 23:59:60 and {XXXX-XX-XX + one day} 00:00:00, so that the clock sticks during a positive leap second; that's why you can't turn "Seconds Since the Epoch" into what the SUS calls a "Coordinated Universal Time name" and always get the correct "Coordinated Universal Time name".)
(And, no, CLOCK_MONOTONIC won't do it, as that's time "since some unspecified starting point", so only differences between CLOCK_MONOTONIC values are meaningful. I can has CLOCK_REALTIME_BUT_NOT_FUCKED_UP_BY_LEAP_SECOND_POSIX_CRAP?)
Well remember when there were only 10 months per year..... I don't know what the world is coming to nowadays.
All cows eat grass!
&& year == leapyear
Leap seconds aren't necessarily only applied in a leapyear.
God: An invisible friend for grown-ups.
who's code are you quoting? you might have mistakenly replied to the wrong comment; i never mentioned leap years.
My bad, should have been a reply to #38599414
God: An invisible friend for grown-ups.
Word. That's what I figured. But you wouldn't have been the first person on Slashdot to misquote and mischaracterize someone.