This project is archived and is in readonly mode.

#1796 ✓resolved
Levin Alexander

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

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

Pages