Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^2: Why does localtime() return 1900-$YEAR?

by apl (Monsignor)
on Jan 31, 2011 at 12:44 UTC ( #885262=note: print w/replies, xml ) Need Help??

in reply to Re: Why does localtime() return 1900-$YEAR?
in thread Why does localtime() return $YEAR-1900?

Further, you need 11 bits to specify 1999, while only 7 are necessary for 99. Believe it or not, being able to to save 4 bits a record (or structure) was a big deal back in the '70s...

Yes, I'm a dinosaur, as I've been programming since 1972...

  • Comment on Re^2: Why does localtime() return 1900-$YEAR?

Replies are listed 'Best First'.
Re^3: Why does localtime() return 1900-$YEAR?
by szabgab (Priest) on Jan 31, 2011 at 13:51 UTC
    Perl was first released in 1987. The memory issue was much less important by that time and I am quite sure people were already aware of the bug 2000.

    Though that's an interesting other question. When did people start to talk about "bug 2000"?

      Dunno, but Perl has already addressed the y2038 bug. That's when the years would overflow even when subtracting 1900.
      Hmm, I worked on a COBOL system with 2 digit dates in the late 80's / early 90's and there was no pressure to modify the date structures. So I'm not sure people were as prescient as you assume.

      The first time I heard mention of the Y2K issue was '97 when a friend let it be known to a recruiter that I could work in COBOL >>>Shudder<<<

      print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."
      Perl was first released in 1987.
      Quite true, but the Unix time structure (which defined the year as an offset from 1900) has been a de facto standard since around 1975.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://885262]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2020-10-20 08:18 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (209 votes). Check out past polls.