From: Greg Hazel Date: 2011-01-20T11:43:46+09:00 Subject: [ruby-core:34636] [Ruby 1.8-Bug#4295][Open] Time.utc(1960) raises ArgumentError: argument out of range (on Windows) Bug #4295: Time.utc(1960) raises ArgumentError: argument out of range (on Windows) http://redmine.ruby-lang.org/issues/show/4295 Author: Greg Hazel Status: Open, Priority: High Category: core ruby -v: ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32] On Windows: irb(main):001:0> Time.utc(1960) ArgumentError: argument out of range from (irb):1:in `utc' from (irb):1 irb(main):002:0> Time.utc(1970) => Thu Jan 01 00:00:00 UTC 1970 Occurs on (at least) 1.8.6, 1.8.7 and 1.9.1. Bug seems to still be present in 1.9.2 source. This is critical because timestamps stored in MySQL pass through Time.utc when being loaded automatically by ActiveRecord. With this bug, there is no way to load a record which contains timestamps before 1970 - for example, someone's birthday. Most likely, this bug is due to the use of time_t functions on Windows, which return time_t expressed as seconds since 1970. However, time_t is defined as a signed int, and NEGATIVE_TIME_T could be defined. gmtime and localtime could be replaced with functions which take negative time_t and use FILETIME internally, which supports dates since year 1601. ---------------------------------------- http://redmine.ruby-lang.org