有谁知道为什么Time.parse
似乎误解了偏移?
# Correct:
ruby-1.9.2-p136 > DateTime.parse "2011-04-07T13:53:00-3"
=> Thu, 07 Apr 2011 13:53:00 -0300
ruby-1.9.2-p136 > Time.parse "2011-04-07T13:53:00-3"
=> 2011-04-07 13:53:00 +0300
格式似乎没有任何区别:
ruby-1.9.2-p136 :027 > Time.parse "2011-04-07T13:53:00-0300"
=> 2011-04-07 19:53:00 +0300
ruby-1.9.2-p136 :028 > Time.parse "2011-04-07T13:53:00-03"
=> 2011-04-07 19:53:00 +0300
ruby-1.9.2-p136 :029 > Time.parse "2011-04-07T13:53:00-03:00"
=> 2011-04-07 19:53:00 +0300