Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Bug in to_date with Ruby 1.8.7 and Rails 3.0.11

By: a guest on Apr 3rd, 2012  |  syntax: Rails  |  size: 0.66 KB  |  views: 45  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. % ruby -v                                                                                                                                                                               !10391
  2. ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
  3.  
  4. % bundle exec rails console
  5. Loading development environment (Rails 3.0.11)
  6. >> Time.now
  7. => Tue Apr 03 13:07:13 +0300 2012
  8. >> Time.zone
  9. => #<ActiveSupport::TimeZone:0x10168d650 @tzinfo=#<TZInfo::TimezoneProxy: Etc/UTC>, @name="UTC", @utc_offset=nil, @current_period=nil>
  10. >> Time.zone = "Chihuahua"
  11. => "Chihuahua"
  12. >> Time.zone.now
  13. => Tue, 03 Apr 2012 04:07:30 MDT -06:00
  14. >> Time.zone.now.to_date
  15. => 2012-04-02
clone this paste RAW Paste Data