The Quickly Descending Unix Timestamp 272
Teach writes: "If my calculations are correct, on Thursday, April 19, 2001, at 04:25:21 UTC (00:25:21 EDT and late Wednesday at 21:25:21 PDT), the UNIX clock will read 987654321, which is pretty cool. This will be the first of two such "significant" events in 2001, the second being 01:46:39 UTC on 2001-09-09, when the clock will read 999999999 (and then of course "roll over" to 1000000000 one second later). Use the Time Zone Converter to help you figure out when this will occur in your area, or read up on other
critical dates (such as when the 32-bit signed UNIX clock overflows in 2038)."
Are we coming up to an "S1B" bug? (Score:5)
Not many programs are gonna care how many digits are in a timestamp, but I bet some do try to format stuff assuming a less-than-one-billion-seconds-since-epoch time.
Review your code?
How are we going to discuss this?? (Score:2)
How are we supposed to discuss this?
Its like when the "annoying" guy comes into your cube and says some dumb fact, like "hey, the timestamp will be 987654321 soon!", and you try to ignore him so he'll go away...
2038? (Score:2)
This is truly stuff that matters (Score:1)
Pointlessly,
~jawad
It's like an odometer (Score:5)
Nobody will know the difference save the occasional hidden-camera "consumer protection" reporterette. These people seem to have nothing better to do than spy on semi-honest computer salesman and publicly humiliate them for the crime of trying to feed their families. We could talk about the silliness of having to disclose whether or not your computer had its case straightened after a minor plastic-bender, but that would be a whole nother post....
Palindrome's though common should qualify (Score:1)
NEWS FLASH: This is old news. Truely, it is. (Score:1)
I have some REAL news I must share with ya'll...
NEWS BULLETIN: Poland's worst air disaster occurred today when a small two-seater Cessna 152 plane crash landed into a cemetery early this afternoon in central Poland. Polish search and rescue workers have recovered 826 bodies so far and expect that number to climb as digging continues into the evening.
Please remove BOOGERS when sending me eMail. Thankyou...
Sincerely,
Re:This is truly (NOT) stuff that matters (Score:1)
If calling 1/1/01 the Millenium wasn't geeky enuf (Score:1)
Something to Celebrate (Score:1)
a "Billion Seconds of Unix" party sounds like a great idea to me....
- jonathan.
The Moral Majority was disbanded in 1989
timestamp -- divine intent! (Score:2)
You see, neither would a rational and benevolent deity allow the unix timestamp to lap like that. The commotion involved would be significantly worse than the Y2K bug was, because at least with the millennium, people knew to be on the lookout for all sorts of strange behavior (not just computer bugs). But 2038? What kind of date is that? Where's your catchy three-syllable mnemonic for that one?
So clearly, there has to be another explanation. Mine is that Armegeddon will intercede and prevent this disaster from occurring. A rational and benevolent deity would realize that it would be far better for the universe to be destroyed than for time to cease.
This poses all sorts of interesting moral, legal, and ethical questions. What should we do about debts that are set to expire after 2038? Should mandatory euthenasia be implemented on all infants born after 2036 so as to avert their agony when the heavens open up and the clarion trumpets of Judgment call forth the arrival of hellfire and brimstone? Will we be able to sublet our cottages in Boca as we've grown accustomed to doing?
This calls for immediate discussion. A committee of learned professors in each of the relavent disciplines (religion, philosophy, sociology, art history) must convene and solve this problem before it becomes the death of us. We have only thirty seven more years left, so let's make the best of it.
Using Perl.... (Score:5)
perl -MPOSIX -le 'print ctime(999999999)'
perl -MPOSIX -le 'print ctime(987654321)'
For another timezone, you can just set the TZ environment variable. On the command-line, or in the code:
perl -MPOSIX -le '$ENV{TZ}="CST";print ctime(200)'
Actually, because there are historical reasons for ctime supplying a newline, you can drop the "l" from "-le".
Ascending... (Score:2)
Re:timestamp -- divine intent! (Score:1)
My catch 3-syllable acronym for the 2038 bug is....
Y38
Ha! (Score:2)
Victor
UNIX timestamps (Score:1)
Will I be able to view the UNIX times on my Linux box?
Re:2038? (Score:2)
Re:timestamp -- divine intent! (Score:1)
Wow (Score:1)
Yeah, but... (Score:1)
Java time (Score:5)
Time zones (Score:1)
Eleven.
Eleven? [negativland.com]
It's not even funny. It's ridiculous.
Re:timestamp -- divine intent! (Score:1)
Re:This is truly stuff that matters (Score:1)
Re:If calling 1/1/01 the Millenium wasn't geeky en (Score:1)
NON-geek friends? What kind of geek are you?
Re:Are we coming up to an "S1B" bug? (Score:1)
And this was flamebait how? Remember, moderators: it's not just clicking on the little buttons, it's also about reading the post.
In other random news: (Score:2)
Re:Are we coming up to an "S1B" bug? (Score:1)
--
Look, ma, no modules! (Score:5)
perl -le 'print scalar gmtime(999999999)'
And of course localtime() for your own timezone.
Re:How are we going to discuss this?? (Score:2)
--
Re:2038? (Score:1)
--
Re:timestamp -- divine intent! (Score:1)
Oh wait, that's 42. Never mind.
Re:Java time (Score:1)
Using Shell and GNU date (Score:2)
tells you in your local time when that event will happen... (well evntually it is 1 second off if the first date terminates not in the same second as the second... lg mond.
Its just a birthday celebration of time! (Score:2)
But tell us... (Score:3)
OK, but when are we going to get the Slashdot User #987654321 throw-down troll account?
We went from 100000 to 400000 so fast that I wouldn't expect it to take too much longer.
--
something to discuss (Score:2)
Re:Ascending... (Score:2)
Hmm.....nice wording (Score:2)
Solution to 2038 bug (Score:2)
I think the best solution to the year 2038 bug is simply to roll everybody's clock back to the year 1970. Problem solved!
Besides, disco was so groovy, wasn't it? Yeah, baby, yeah!!
--
Other significant happenings on that date... (Score:2)
The other significant thing that will happen on that date is that moderators the world over will be confused, wondering if the moderation guidelines [slashdot.org] actually changed or not.
(This is in reference to the message moderators get saying "Have you read the Moderation Guidelines [slashdot.org] yet? Updated 9.9". They were updated 9/9/1999, which I guess was such a cool date that they never bothered changing it again, just updated the FAQ [slashdot.org]. Of course, saying "Updated 9.9.99" would be even cooler. Maybe CmdrTaco is waiting for 1.1.11 to update them again, or even 2.2.2222...
Re:assistance (Score:2)
--
Also..... (Score:5)
Thu Nov 29 13:33:09 1973
(please do not waste mod points on this post, thanks)
Re:Java time (Score:2)
The part I thought was optimistic was the press release where they promised to have a fix available at least 30,000 years in advance.
Re:Are we coming up to an "S1B" bug? (Score:4)
In fact, the poster is absolutly correct- Kmail did have exactly the kind of bug he's talking about - a one billion second buffer overrun bug. They issued a patch a few weeks ago.
read about it here [kde.org]
-henrik
Re:Are we coming up to an "S1B" bug? (Score:5)
There is another 999999999 rollover problem. Some admin scripts (in BASH, PERL, etc.) assume that the decimal timestamp can be compared as an ASCII string. Unfortunately, 999999999 > 1000000000 in this case, which can cause such scripts to break in subtle or overt ways. For example, if TS1=999999999 and TS2=1000000000, the BASH statement:
if [ $TS1 ">" $TS2 ]; then
will evaluate as true.
Re:Hmm.....nice wording (Score:3)
Unfortunately you don't have until 2038 in this case.
The Divine intention is pretty clearly... (Score:2)
...that anybody still using a 32-bit system in four decades deserves what he gets.
Come on, does that sound so likely? Four decades ago you were lucky to be able to afford all 8 bits in your 8-bit system. And the graph is not a linear one (think Moore here), so four decades from now they'll be laughing at us for working in such a cramped 32-bit address space.
Solaris has been 64-bit for years now. Same for a number of other Unixes. If somebody is honestly worried about time_t, tell him that a 64-bit time_t can hold more seconds than the probable remaining lifetime of the universe.
The Divine intent is the same here as it is for folks driving fast in highway construction zones: stupid people deserve what happens to them.
Re:Look, ma, no modules! (Score:2)
Actually, the fun part is using strftime to pull out all sorts of details like:
perl -MPOSIX -le 'print strftime("24HR time: %H%M",localtime 999999999)'
or
perl -MPOSIX -le 'print strftime("It is on a %A", localtime 999999999)'
Fun stuff. Perl is your friend.
(and yes, the Python snipe was humor. I have a deep respect for Python even if ESR is a dink about the "recovered Perl programmer" thing...)
Re:signed? (Score:2)
Whether or not UNIX will be running before 1970, it still might be useful to store dates before 1970, such as birthdates, etc.
"One Billion Seconds of Unix" (Score:4)
Heck, that might even be a big enough party to be called a "Conference."
Watch it live... (Score:3)
watch -n 1 date +%s
or better yet:
watch -n 1 'echo "The time is near: `date +%s`"'
Simpler solutions: 64-bit or unsigned (Score:2)
I think the best solution to the year 2038 bug is simply to roll everybody's clock back to the year 1970
There's a simpler solution: typedef unsigned long time_t; should take us into the 22nd century before we have a problem. (The DJGPP C library already does this.) Another solution is typedef long long time_t; which is on nearly the same order of magnitude as the best estimates for the age of this universe.
Unsigned long (Score:2)
Also, I don't know if this is just a Perl thing, but dates "past" 2**31-1 (i.e., negative numbers when "signed") seem to be used to represent dates far before 1970.
For example:
% perl -le 'print scalar gmtime(2**31)'
Fri Dec 13 20:45:52 1901
% perl -le 'print scalar gmtime(2**31+2)'
Fri Dec 13 20:45:54 1901
% perl -le 'print scalar gmtime(2**31+2**30)'
Mon Dec 23 10:22:56 1935
Re:2038? (Score:2)
Either that or they're upset at the Depend Undergarment remark because it reminded them to change their own.
Ok, maybe I'm looking too far into the future, but (Score:2)
Date of birth (Score:2)
Is there any logical reason for the date to be using a signed number as opposed to unsigned?
I assume that the architects of the system wanted to represent their date of birth. It's the same thing that motivated the Mac OS designers to choose 1904 as the Mac's (unsigned) epoch.
Re:timestamp -- divine intent! (Score:2)
Final and decisive proof of my suspicion that some dark cabal - or group of people in desparate need of a life - has been screwing with the moderation system of late.
I suspect that this will either be modded down to -1 to bury all evidence, or modded up so that they may gloat in their accomplishment.
Tom Swiss | the infamous tms | http://www.infamous.net/
Other significant dates, albeit "RL"... (Score:2)
3/3/2001 - all sections add up to 3. Also, it's an Odd Day - all non-zero digits are odd, AND all sections are odd, AND all section's digits sum up to odd totals. Since these are also all prime, it was also a Prime Day.
Trivia Question: When will be the next Prime Millisecond, as measured by RL -and- by the Unix clock?
Picking patterns out of noise... (Score:2)
--
Scott Robert Ladd
Master of Complexity
Destroyer of Order and Chaos
Re:illegalities (Score:2)
No it's not, I can go out and buy some right now, walk over to the police building and offer some to one of the officers, he'll probably smile at me and refuse the offer.
just because it's illegal in your lame-ass country doesn't mean it's illegal everywhere
---
Re:Ok, maybe I'm looking too far into the future, (Score:2)
Actually, this is of practical value (Score:2)
Does anyone know ... (Score:2)
---
Re:Solution to 2038 bug (Score:2)
Re:2038 - Now is the time to start work (Score:2)
This is useable and sensible. I can see this.
[inserting tongue in cheek]
But we might not need to worry because of all of the other disasters that are proposed to be happening between now then then, including the end of the Maya Epoch [survive2012.com] (get your Mayan Date TShirt here [halfmoon.org], and the destruction of civilization by asteroids in 2028 (orbit info here [nasa.gov], Seattle Times disinfo here [nwsource.com], commentary here [wisc.edu])
And, with the crashomatic feature in MS OS software, the world will come to an end well before that when the MS .NET system gets hit with a succesful .NET virus that wipes out lots of data from the hard drives. Of course, it will be a MS email virus, that scans the network for vulnerable files.
Check out the Vinny the Vampire [eplugz.com] comic strip
Re:Are we coming up to an "S1B" bug? (Score:2)
There is a difference between ">" and -gt in BASH as well. But that doesn't keep people from doing it wrong.
Re:Simpler solutions: 64-bit or unsigned (Score:2)
I may want to add a negative time increment to the current time to calculate some past date. Adding a signed to an unsigned doesn't always work so well
Changing time_t is not a transparent change. Might as well make it 64bit unsigned, and take the migration penalty once, across the board, as opposed to randomly, on some apps, after you thought they were working for a few months of production use.
Re:Other significant dates, albeit "RL"... (Score:2)
Except for the digit "2".
Re:timestamp -- divine intent! (Score:2)
The three letter acronym (Score:2)
Re:The Divine intention is pretty clearly... (Score:2)
"Probable"? What other dead universes are you using for a benchmark? And who is giving odds on these probabilities?
--
Re:Yeah, but... (Score:2)
>perl -MPOSIX -le 'print ctime(0x69696969)'
Thu Jan 15 20:25:45 2026
But of course (Score:2)
987628906
987628907
987628908
.
.
.
Obvious 64-bit solution duh (Score:2)
32-bit systems can only store a maximum of 2^31 non-negative seconds (2,147,483,648 seconds or about 68 years). Which means that 32-bit UNIX systems won't be able to process time beyond 19 Jan 2038 at 3:14:07 AM UTC.
One of the common solutions will be to switch to 64-bit architecture systems that can store a maximium of 2^63 non-negative seconds (9,223,372,036,854,775,808 [9.2 Quintillion] seconds or about 292.27 Billion years), which would be sufficient for quite a long time!
Re:The Divine intention is pretty clearly... (Score:2)
And if you wrote code like:
long mytime;
time(&mytime);
Then you deserve the coredump you're going to get. They didn't create types like time_t and size_t without a reason, you know.
Re:"One Billion Seconds of Unix" (Score:2)
STOP, do not tell your friends about this issue (Score:3)
Redmond WA.
Today Bill Gates announced that all *nix systems will halt with the September 9th coming of the S1B bug. MSNBC recommends that all *nix users switch to Windows XP before it is too late. Steve Balmer was reported to say how amazed he was that *nix could be so short sighted. XP was designed to be S1B compliant right from the start (after installing SP8 due sometime in September). All you Windows users will be kept safe from this, and should not consider going to any rogue operating systems at this time.
Re:Other significant happenings on that date... (Score:2)
Re:Date of birth (Score:2)
That link is fascinating reading (Score:2)
Re:"One Billion Seconds of Unix" (Score:5)
Predicted party song:
--
Not a mnemonic, but a slogan... (Score:2)
Re:Obvious 64-bit solution duh (Score:2)
As has been stated elsewhere, Java uses 64bit time on the same epoch, but counts milliseconds instead of seconds. Easy conversion, and we can only measure 292.27 million years.
Re:That link is fascinating reading (Score:2)
Alex
So where's the party for All Nines Day? (Score:2)
So pack those beers, grab the munchies, set up a *n?x computer with a BIG display showing the countdown and invite all your appreciative geek friends over. Forget the end of the millenium; the stupids celebrated it a year too early anyway. This is the REAL once-in-a-lifetime event....
--
The meaning is obvious. (Score:2)
Corollary: Every IA-64 delay makes it more likely that Intel executives will burn in hell.
Re:Hmm.....nice wording (Score:2)
Weird behavior is expected in Windows, so when UNIX does it, everybody just stares in awe...
Re:Java time (Score:2)
2E69 approx. - A.D. 1,834,652,618,499,343,590,337,415,746,119,712,509, 834,124,421,548,072,260,582,352,567,003,896-01-25 Sat 17:06:08 GMT, UNIX 256-bit signed time_t fails.
I'd say that's looking far into the future. =)
-Cyc
Re:impressive (Score:2)
So let me get this straight the mightiest country in the world The United States of America is lame?
yes it is. all this talk about how much freedom you're supposed have when in fact it's not that free at all.things like softdrugs and prostitution are illegal, you'll probably say that it's not good for you to use softdrugs or not moral to go to a hooker, but at least I made that decision for myself instead of that the government made it for me.
I have the freedom to choose and set my own standards, you don't.
---
Re:impressive (Score:2)
Probably Holland.
yepBeen there once, very interesting place. Friendly people and travelling is really easy due to the excellent mass transportation systems. I dunno why Amtrak and friends even bother anymore :(
actually, they're working on making the trains run better according to schedule.nowadays you can even get a refund if a train is delayed too long
---
Why stay with 32 bits? (Score:2)
My primary occupation is to build ASP applications in PHP - and the 32 bit timestamp is a decided limiting factor.
So we move to a 64-bit epoch - I don't see any particular problem doing so NOW... but in 37 years it just might be a REAL PROBLEM.
Why isn't this done? Why don't the kernel developers for Linux just do this, using a slightly different system call? (xtime() instead of time() or whatever)
A compatability function could SO EASILY be added now, and then software can be written that takes advantage of the extended API...
signed date? (Score:2)
Sorry, but seeing bad programming practices like this just make be a little upset especially for a supposedly robust system such as Java.
Re:"One Billion Seconds of Unix" (Score:3)
time_t is a type, not a variable. You can't store a value in time_t. 8-)
------
Re:disagreement (Score:2)
--
I wrote a program with an S1B bug (Score:2)
The bug was spotted by co-author Jeff Allen, who suggested this fix: *invert* the time with "~". That should keep going until the 32-bit clock runs out in 2038.
#!/usr/bin/perl -0777i_MUNITION,see_http://ciphersaber.gurus.com
(pop)?read STDIN,$p,10:print$p= ~time;sub S{@s[$x,$y]=@s[$y,$x]}sub
Q{$s[($_[0]+=$_[1])%=@s]}@k=unpack'C*',(pop).$p
Q$y,$k[$x%@k]+Q$x}$x=$y=0;print map{chr($_^Q S Q$y,Q$x,1)}unpack'C*',<>
I've had to introduce a space in ";for" to get around Slashdot's random space adding system (bah!) - the minimal version is on my Web pages. Incidentally, the ~ fix didn't save a character, because we still had to leave a space between the = and the ~ since =~ is a distinct Perl token...
--
Re:2012 (Score:2)
Some people theorize that rather than the magnetic polarity of the poles switching, the weight of the icecaps on the poles will cause (and has caused before) the crust of the earth to actually slide over the molten center, as if it were an orange with a loose peel. This would, of course be a highly catastrophic event. Suddenly, the poles are at the equator, the oceans slosh out of their basins, scouring the continents...
Check out "Footprints of the Gods" by Graham Hancock for more details about this and other far-out but suprisingly well researched and supported theories.
Re:Solution to 2038 bug (Score:2)
Man, if it was 1970 we'd still have to wait 7 or 8 years for disco... where's your music history?
Sheesh, kids nowdays...
Re:Java time (Score:2)
Re:Unless... (Score:2)
Apr 20, 2001 12:57:09 AM
Whereas localtime() gives you back a struct! The eqivilent is more like new GregorianCalendar() which gives you a handy calendar for the current locale and the current time (more than you'd get from a struct tm actually!) from which you could extract month/day/year/etc. fields.
Now, as for outputting that struct in C the same as the Java code you gave, I won't go into that. I will show you two ways to shorten the Java though:
1) new Date().toString() produces:
Fri Apr 20 00:57:09 PDT 2001
(not localized)
2) If you need the output to be correct for your locale, you can shorten what you had a little:
DateFormat.getDateTimeInstance().format(new Date()) )
Which doesn't look so bad, considering all the benefit you get from it!
The summary - use new Date() instead of Calendar.getInstance().getTime()!!