Skip to content

Commit 88dc93e

Browse files
authored
Merge pull request rails#52371 from jhawthorn/time_with_zone_inspect
Update TimeWithZone#inspect to match Ruby 1.9+ ISO 8601 format
2 parents cf976b0 + 0b12b98 commit 88dc93e

File tree

3 files changed

+242
-238
lines changed

3 files changed

+242
-238
lines changed

activesupport/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* `ActiveSupport::TimeWithZone#inspect` now uses ISO 8601 style time like `Time#inspect`
2+
3+
*John Hawthorn*
4+
15
* `ActiveSupport::ErrorReporter#report` now assigns a backtrace to unraised exceptions.
26

37
Previously reporting an un-raised exception would result in an error report without

activesupport/lib/active_support/time_with_zone.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def zone
138138
#
139139
# Time.zone.now.inspect # => "Thu, 04 Dec 2014 11:00:25.624541392 EST -05:00"
140140
def inspect
141-
"#{time.strftime('%a, %d %b %Y %H:%M:%S.%9N')} #{zone} #{formatted_offset}"
141+
"#{time.strftime('%F %H:%M:%S.%9N')} #{zone} #{formatted_offset}"
142142
end
143143

144144
# Returns a string of the object's date and time in the ISO 8601 standard

0 commit comments

Comments
 (0)