Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: 2038 bug

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

in reply to 2038 bug

One solution to make your code survive longer is: (solution is tested with various dates set to points after 2038)
  1. turn on big int for the right lexical scopes, and
  2. do this convertion:
    my $t = time(); $t += 2 ** 32 if ($t < 0);
    This would make the epcho value increase smoothly even after 2038 (but not forever).

    The logic behind the convertion: time() returns (- 2** 31) for 2038-01-18-20:14:07, which should be 2 * 31; returns (-2**31 + 1) for 2038-01-18-20:14:08, which should be (2 ** 31 + 1) and ... so the difference between what returned from time() and what it should be is always 2 ** 32.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://249825]
[Corion]: Discipulus: Better buy a new PC (well, self-build one from parts) than buy a new car :-)
[choroba]: the boot time on my laptops is more than satisfactory, but the desktop boots in 30+ secs
[choroba]: because of some problems of the wicked with systemd :-(
[Corion]: choroba: Just imagine how bad it must be without systemd ;-D
[choroba]: but I'm not sure it's worth my time...
NodeReaper shudders
[Corion]: choroba: That chart is frustrating as it pits cold hard numbers against puttering around with an annoying problem :)

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2017-07-27 09:16 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (407 votes). Check out past polls.