Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Re: 2038 bug

by pg (Canon)
on Apr 11, 2003 at 05:10 UTC ( #249808=note: print w/replies, xml ) Need Help??

in reply to Re: 2038 bug
in thread 2038 bug

he cannot really fix it on his own. Try this: on your PC, set date to 01-01-2039, by doing this:
date 01-01-2039
then run this perl program:
print time();
you will get a negative number back. That's the limitation sort of thing, not a bug in his code. Try this code:
print time(); # set time to 01-01-2038 before try this code print(2 ** 31 - 1);
Look at how close those two numbers are, now you realize that's the up limitation of positive integers on 32 bit machine.

I don't worry about this too much, most likely when 2038 approaches, 64 bit or something even better will dominate.

(Set time to 2038-01-18-20:14:06, and see what happens to the above demo, also 2038-01-18-20:14:07)

Replies are listed 'Best First'.
Re: Re: Re: 2038 bug
by Anonymous Monk on Apr 11, 2003 at 05:24 UTC

    Thanks for the correction, the thought had crossed my mind, but I didn't think we were anywhere near that close (guess I should do my math next time ;). time to dust off the ol' quantum computer, only 35 years to get it working! :)

      you forget that it is not necessary to be exactly at some date to deal with. Any operations with future dates should be possible.
      Or may be you're surprised by long-time credits and calculating percents on the sum? Calculations of pension?

      Courage, the Cowardly Dog

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://249808]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2018-02-20 04:16 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (267 votes). Check out past polls.