Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

TimeWithZone#to_formatted_s drops timezone information

#1796

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.

Reported by Levin Alexander · January 26th, 2009 @ 03:00 PM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Levin Alexander
  2. Levin Alexander
    Levin Alexander
    • Tag changed from 2.2.2, activesupport, timewithzone to 2.2.2, activesupport, patch, timewithzone

    attached patch

    January 27th, 2009 @ 04:26 PM

  3. Repository
    Repository
    • State changed from new to resolved

    (from [18d636934492fd657a67dc980b8556bcf69a818d]) Make TimeWithZone#to_formatted_s an alias to TimeWithZone#to_s [#1796 TimeWithZone#to_formatted_s drops timezone information state:resolved] http://github.com/rails/rails/co...

    February 8th, 2009 @ 05:37 PM