Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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

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 having an uproarious good time at the Monastery: (6)
As of 2016-10-22 04:33 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (292 votes). Check out past polls.