Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Re: 2038 bug

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

in reply to Re: 2038 bug
in thread 2038 bug

(After I read tachyon's post again, I thought I should add this comment. i should not second guess his thought too much, and simplify his thought. Any way, I still leave this post here, as some sort of helper to his post.)

The $begin - $end approach would not work, assume that we get both from a function like time().

The problem is that, for time(), after it steps over the biggest positive integer, it would go directly to the smallest negative integer, i.e. the negative integer with the biggest absolute value.

For example, if $begin is 2038-01-18-20:14:06, and $end is 2038-01-18-20:14:07, although there is only 1 second difference, by calling time(), and do $begin - $end, you will get:

2 ** 31 - 1 - (- 2 ** 31) = 2 ** 32 - 1

Comment on Re: Re: 2038 bug
Replies are listed 'Best First'.
Re: Re: Re: 2038 bug
by tachyon (Chancellor) on Apr 11, 2003 at 06:18 UTC

    Of course it will work. I said abstract *all time manipulation* into a module. This obviously includes getting the current time from time(). The abstraction is the main thing as it lumps all the problems in one festering little bucket.




Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2015-10-04 21:30 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (105 votes), past polls