in reply to Re: Converting epoch times after 2038
in thread Converting epoch times after 2038

Be careful with that on 32-bit platforms, since on 32-bit platforms 1 << 33 will be 2 regardless of wether localtime() will handle values larger than 32 bit.

As an additional data point, my 32bit linux 2.6.18 / GNU libc 2.3.6 box doesn't handle them.

  • Comment on Re^2: Converting epoch times after 2038

Replies are listed 'Best First'.
Re^3: Converting epoch times after 2038
by parv (Parson) on Apr 05, 2007 at 16:18 UTC
    Be careful with that on 32-bit platforms, since on 32-bit platforms 1 << 33 will be 2

    ... when perl is not built with 64-bit integer support (here it is "v5.8.8 built for i386-freebsd-64int" (32 bit architecture)) ...

    perl -we 'print map { sprintf "%d %d\n" , $_ , ( 1 << $_ ) } ( 30 .. +34 , 60 .. 65 ) ' 30 1073741824 31 2147483648 32 4294967296 33 8589934592 34 17179869184 60 1152921504606846976 61 2305843009213693952 62 4611686018427387904 63 -9223372036854775808 64 1 65 2