From: Tim Ferrell Date: 2008-01-07T06:24:44+09:00 Subject: Re: Time.gm(1969) chokes on Windows Ryan Davis wrote: > > I'm gonna have to call bullshit on this one, given that you were asked > twice to provide the bad YAML in question and it never materialized, > but especially given that the following seems to work just fine: > > >> YAML.dump(Time.gm(1969, 1, 1)) > => "--- 1969-01-01 00:00:00 Z\n" > >> YAML.load(YAML.dump(Time.gm(1969, 1, 1))) > => Wed Jan 01 00:00:00 UTC 1969 Ryan, you obviously didn't follow closely enough... :-) That code simply does not work on Windows. >> YAML.dump(Time.gm(1969, 1, 1)) ArgumentError: time out of range from (irb):2:in 'gm' from (irb):2 Nor does this: >> Yaml.load("--- 1969-01-01 00:00:00 Z") ArgumentError: time out of range from C:/Ruby/lib/ruby/1.8/yaml/rb:133:in 'utc' from C:/Ruby/lib/ruby/1.8/yaml/rb:133:in 'node_import' from C:/Ruby/lib/ruby/1.8/yaml/rb:133:in 'load' from C:/Ruby/lib/ruby/1.8/yaml/rb:133:in 'load' from (irb):3 And yes, Jamey, it is not Syck's fault that the Time class is broken in this way on Windows. Syck could have alleviated some of the pain by making the more sensible (i.e. portable, reliable) choice of using DateTime to deserialize, but the bottom line IMO is that this is a core issue and should be fixed. -- Posted via http://www.ruby-forum.com/.