On Thu, 11 Dec 2008 13:58:05 +0100, Fernando G. [email protected] wrote:
Time.local(2038, 1, 19)
=> Tue Jan 19 00:00:00 +0100 2038
Time.local(2038, 1, 20)
ArgumentError: time out of range
from (irb):33:in `local’
from (irb):33
It looks like Time class is not available to manage dates bigger than
2038/01/19.
Being a user of 64 bit operating systems for over a decade now
(initially on Digital Unix), I sometimes find it surprising that so many
people are still using 32 bit operating systems. On my 64 bit Fedora
there is no issue with that date:
Time.local(2038, 1, 19)
=> Tue Jan 19 00:00:00 0100 2038
Time.local(2038, 1, 20)
=> Wed Jan 20 00:00:00 0100 2038
$ uname -a
Linux pen2.homeunix.net 2.6.27.5-41.fc9.x86_64 #1 SMP Thu Nov 13
20:29:07 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
On Thu, Dec 11, 2008 at 6:58 AM, Fernando G. [email protected] wrote:
It looks like Time class is not available to manage dates bigger than
2038/01/19.
I have found this conversation:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/190564
It’s not a ruby bug per say, it’s a general problem that 32bit systems
have with unix time. Unix time is stored in seconds since the epoch,
in a native unsigned integer, which on most systems is 32 bits. On
64bit systems, this obviously isn’t a problem.
$ uname -a
Darwin macbook-de-fernando-guillen.local 9.5.0 Darwin Kernel Version
9.5.0: Wed Sep 3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
i386
Err, I should have mentioned, many UNIX and UNIX like systems have
switched to using a 64bit integer, even some running on 32 bit
processors I believe (but don’t quote me on that).