Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: 2038 bug

by Anonymous Monk
on Apr 11, 2003 at 05:03 UTC ( #249807=note: print w/ replies, xml ) Need Help??


in reply to 2038 bug

Why not just fix it? Post the code, we'll help out, honest.


Comment on Re: 2038 bug
Re: Re: 2038 bug
by pg (Canon) on Apr 11, 2003 at 05:10 UTC
    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)

      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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2014-08-21 04:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (127 votes), past polls