From: Kyle Banker Date: 2011-01-19T01:16:30+09:00 Subject: [ruby-core:34558] [Ruby 1.9-Bug#4291][Open] rb_time_new with negative values (pre-epoch dates) on Windows Bug #4291: rb_time_new with negative values (pre-epoch dates) on Windows http://redmine.ruby-lang.org/issues/show/4291 Author: Kyle Banker Status: Open, Priority: Normal ruby -v: ruby 1.9.2p136 (2010-12-25) [i386-mingw32] rb_time_new does not handle negative values (and thus pre-epoch dates) on windows. It seems like it should given that Time.at does. ruby 1.9.2p136 (2010-12-25) [i386-mingw32] Pure ruby does work: irb(main):005:0> sec = Time.utc(1600).to_f => -11676096000.0 irb(main):012:0> Time.at(sec).utc => 1600-01-01 00:00:00 UTC But in a C extension, it does not work: value = rb_time_new(-11676096000, 0); value = rb_funcall(value, utc_method, 0); This results in a Time object with this value: 2008-04-21 19:24:48 UTC (12884901888.0) Where we wanted 1600-01-01 Note that the problem in on Windows only. Other platforms work fine. ---------------------------------------- http://redmine.ruby-lang.org