Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
ActiveSupport::TimeWithZone#strftime responds incorrectly to %:z and %::z format strings #6962
Environment : Ruby(MRI) 1.9.3-p194 and Rails 3.2.6
ActiveRecord::TimeWithZone is supposed to be a drop in replacement for Ruby Time.
irb> Time.zone = "Eastern Time (US & Canada)" => "Eastern Time (US & Canada)" irb> twz = Time.zone.now => Wed, 04 Jul 2012 11:55:11 EDT -04:00 irb> twz.strftime('%z') => "-0400" irb> twz.strftime('%:z') => "+00:00" irb> twz.strftime('%::z') => "+00:00:00"
Pairing with @dhakadamit
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
I came across this issue yesterday. Thanks for reporting it @pastafari.
The workaround I used for my use case was to convert it to a