From efbd62f0c5c927a08e860b318b7bb561b2602a98 Mon Sep 17 00:00:00 2001 From: amitkumarsuroliya Date: Sun, 11 Oct 2015 01:43:08 +0530 Subject: Corrected ActiveSupport `time_with_zone` outputs [ci skip] --- activesupport/lib/active_support/time_with_zone.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index 3592dcba39..d571bbd51c 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -117,8 +117,8 @@ module ActiveSupport # string if the time zone is already UTC. # # Time.zone = 'Eastern Time (US & Canada)' # => "Eastern Time (US & Canada)" - # Time.zone.now.formatted_offset(true) # => "-05:00" - # Time.zone.now.formatted_offset(false) # => "-0500" + # Time.zone.now.formatted_offset(true) # => "-04:00" + # Time.zone.now.formatted_offset(false) # => "-0400" # Time.zone = 'UTC' # => "UTC" # Time.zone.now.formatted_offset(true, "0") # => "0" def formatted_offset(colon = true, alternate_utc_string = nil) @@ -128,14 +128,14 @@ module ActiveSupport # Returns the time zone abbreviation. # # Time.zone = 'Eastern Time (US & Canada)' # => "Eastern Time (US & Canada)" - # Time.zone.now.zone # => "EST" + # Time.zone.now.zone # => "EDT" def zone period.zone_identifier.to_s end # Returns a string of the object's date, time, zone and offset from UTC. # - # Time.zone.now.inspect # => "Thu, 04 Dec 2014 11:00:25 EST -05:00" + # Time.zone.now.inspect # => "Thu, 04 Dec 2014 11:00:25 EDT -04:00" def inspect "#{time.strftime('%a, %d %b %Y %H:%M:%S')} #{zone} #{formatted_offset}" end @@ -143,7 +143,7 @@ module ActiveSupport # Returns a string of the object's date and time in the ISO 8601 standard # format. # - # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-05:00" + # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-04:00" def xmlschema(fraction_digits = 0) "#{time.strftime(PRECISIONS[fraction_digits.to_i])}#{formatted_offset(true, 'Z'.freeze)}" end @@ -284,8 +284,8 @@ module ActiveSupport # the current object's time and the +other+ time. # # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' - # now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28 EST -05:00 - # now - 1000 # => Sun, 02 Nov 2014 01:09:48 EST -05:00 + # now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28 EDT -04:00 + # now - 1000 # => Sun, 02 Nov 2014 01:09:48 EDT -04:00 # # If subtracting a Duration of variable length (i.e., years, months, days), # move backward from #time, otherwise move backward from #utc, for accuracy -- cgit v1.2.3