UNIX PDP-11 Riddle Filter: help me outsmart my computery friend...
April 5, 2009 8:06 PM   Subscribe

UNIX PDP-11 Riddle Filter: help me outsmart my much-beloved but smug computery friend...

he's giving me the business, and thinks I can't figure out the following statement:

if a hacker at MIT running UNIX on a PDP-11 were looking at the time
when i was born, it would look like this:

336451500


Obviously, I can't. I don't even know how to google to begin to figure out the answer! I tried! But, I do know how to harness the power of collective intelligence. So, what time was he born? And, also, since I'm no slouch, I'd love to learn how I'd figure out such a thing if I ever had to again in the future...
posted by lalalana to Computers & Internet (16 answers total) 1 user marked this as a favorite
 
Best answer: He was born at 9:45 PM. August 29, 1980.

It's a unix timestamp. Unix stores times and dates as integers, total number of seconds since "The Epoch" which was January 1, 1970. Find out more at UnixTimestamp.com
posted by frwagon at 8:11 PM on April 5, 2009


Best answer: August 30 1980
posted by miyabo at 8:13 PM on April 5, 2009


Best answer: ((336 451 500 / 365) / 24) / 3600 = 10.6688071 years after Jan 1, 1970.
posted by mrt at 8:13 PM on April 5, 2009


Response by poster: thank you! thank you! thank you! thank you!
I figured SOME of the details were red herrings!
posted by lalalana at 8:14 PM on April 5, 2009


Best answer: ...for completeness' sake, i should mention that I gave that time in Eastern Standard Time. Add 5 hours to it to make it UTC. So, 2:45 AM, August 30, 1980, UTC.
posted by frwagon at 8:14 PM on April 5, 2009


frwagon got it.

The key here is UNIX, not PDP by the way. It is true that UNIX was written originally for the PDP, but the actual hardware architecture is mostly irrelevant to the UNIX time representation. The architecture is a red herring: googling "unix time" immediately yields the proper results necessary to solve the riddle, while "unix pdp-11 time" gives you an awful lot of weird garbage.
posted by Netzapper at 8:18 PM on April 5, 2009


Obligatory XKCD.
posted by SPrintF at 8:23 PM on April 5, 2009


Response by poster: oh, lord, you know things are either really good or really bad when your male friend's cute behavior can always summon an XKCD....
posted by lalalana at 8:26 PM on April 5, 2009


Given the specificity of the place, it's possible that he's being double-sneaky and using a time interval based off of one of the earlier UNIX epochs— it had a handful of other definitions before settling down to its current value. (I'd say portable code still shouldn't rely on any particular epoch, but I'm probably being excessive.)
posted by hattifattener at 9:08 PM on April 5, 2009


thanks to frwagon, miyabo, and mrt calling it, lalalana's friend has been charged with a 15-yard penalty.
posted by the aloha at 9:46 PM on April 5, 2009


The only PDP-11 I ever used used RSTS/E operating system, not Unix... back in the 70s. For a minute there, I thought you could skewer him with that, but what the hey.

You might note that the time stamp is in octal.
posted by FauxScot at 12:57 AM on April 6, 2009


You might note that the time stamp is in octal.

You might, but you'd be wrong.
posted by dmd at 5:35 AM on April 6, 2009 [1 favorite]


MITness isn't a red herring. He's giving timezone information.
posted by cmiller at 7:57 AM on April 6, 2009 [1 favorite]


I agree with hattifattnener. See wikipedia on the Unix Epoch
The earliest versions of Unix time had a 32-bit integer incrementing at a rate of 60 Hz, which was the rate of the system clock on the hardware of the early Unix systems. The value 60 Hz still appears in some software interfaces as a result. The epoch also differed from the current value. The first edition Unix Programmer's Manual dated November 3, 1971 defines the Unix time as "the time since 00:00:00, Jan. 1, 1971, measured in sixtieths of a second".

The User Manual also commented that "the chronologically-minded user will note that 232 sixtieths of a second is only about 2.5 years". Because of this limited range, the epoch was redefined more than once, before the rate was changed to 1 Hz and the epoch was set to its present value.
Using January 1, 1971 as the epoch and 1/60 second as the time per count gives March 1971:
$ python
>>> import datetime
>>> datetime.datetime(1971,1,1) + datetime.timedelta(seconds=336451500/60.)
datetime.datetime(1971, 3, 6, 21, 38, 45)
If your friend was born in the 80s I'd go with frwagon's answer; if the date might be a time in the 70s then I'm not certain there's a clear answer. It looks like by 6th edition unix, 1975, had switched to the 1=one second method of counting time, but I wasn't able to figure out what it used for timezone or epoch…
posted by jepler at 9:17 AM on April 6, 2009


hey guys.... correct me, please.

most of the stuff i did on pdp-11's (in my dusty old memory bin) seemed to be represented in octal? for instance, the front panel of a pdp-11 (all those three-switch groups are octal digits).

http://en.wikipedia.org/wiki/File:Pdp-11-70-panel.jpg

what gives? i just assumed the fact that there no numbers > 7 in that time stamp that it would be a 36 bit quanitity stated in octal?
posted by FauxScot at 2:48 PM on April 7, 2009


Yeah, I'm not sure why dmd is so sure it isn't octal, unless the aloha's comment means that the modern-UNIX-epoch-in-decimal interpretation has been confirmed by lalala's friend.

FWIW, though, I think the PDP-11 was a normal 16/32-bit machine, not a 36-bit machine (the PDP-6, PDP-10 and derivatives were the popular n*18-bit machines, according to Wikipedia). It was still pretty octal-happy though.
posted by hattifattener at 11:55 AM on April 9, 2009 [1 favorite]


« Older The Office 90210   |   She cleaned the house first. Newer »
This thread is closed to new comments.