This project is archived and is in readonly mode.
TimeWithZone#to_formatted_s drops timezone information
Reported by Levin Alexander | January 26th, 2009 @ 03:00 PM | in 2.x
ActiveSupport::TimeWithZone#to_formatted_s drops timezone information in the created string.
>> require 'active_support/version'; ActiveSupport::VERSION::STRING
=> "2.2.2"
>> Time.zone = "Canberra"
=> "Canberra"
>> Time.zone.local(1998,01,19,7,10,12).to_s(:full)
=> "1998-01-19 07:10:12 +1100" # correct
>> Time.zone.local(1998,01,19,7,10,12).to_formatted_s(:full)
=> "Mon Jan 19 07:10:12 UTC 1998" # wrong
on the Time class #to_s and #to_formatted_s are documented to be aliases, so this behaviour was suprising to me.
Comments and changes to this ticket
-
Levin Alexander January 27th, 2009 @ 04:26 PM
- Tag changed from 2.2.2, activesupport, timewithzone to 2.2.2, activesupport, patch, timewithzone
attached patch
-
Repository February 8th, 2009 @ 05:37 PM
- State changed from new to resolved
(from [18d636934492fd657a67dc980b8556bcf69a818d]) Make TimeWithZone#to_formatted_s an alias to TimeWithZone#to_s [#1796 state:resolved] http://github.com/rails/rails/co...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 1796 TimeWithZone#to_formatted_s drops timezone information (from [18d636934492fd657a67dc980b8556bcf69a818d]) Make Ti...