5
我在Rails 3测试版的时区支持方面苦苦挣扎,我想知道它是一个错误还是我做错了什么。他的问题是:Rails 3时区错误
> Time.zone = 'Madrid' # it is GMT+2 => "Madrid" > c = Comment.new => #<Comment id: nil, title: "", pub_at: nil> > c.pub_at = Time.zone.parse('10:00:00') => Mon, 31 May 2010 10:00:00 CEST +02:00 > c.save > c => #<Comment id: 3, title: "", pub_at: "2010-05-31 08:00:00"> > c.reload => #<Comment id: 3, title: "", pub_at: "2010-05-31 08:00:00"> ruby-1.8.7-p249 > c.pub_at => Mon, 31 May 2010 13:00:00 CEST +02:00
正如你所看到的,pub_at属性被正确地存储在数据库中,但是当它被检索它增加了3小时,我怀疑这是因为它是用我的本地时区是在GMT-3。
在rails 2.3.5中相同的命令序列完美地工作。
有没有粘性?我应该报一张票吗?