aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authoramitkumarsuroliya <amitkumarsuroliya@gmail.com>2015-10-11 01:43:08 +0530
committeramitkumarsuroliya <amitkumarsuroliya@gmail.com>2015-10-11 01:43:08 +0530
commitefbd62f0c5c927a08e860b318b7bb561b2602a98 (patch)
tree4fa7861d19bc67bdc23b52f144219b4f3611c84b /activesupport
parent517613c39e3b5130d417989f8f6e1a74ba2ccfc1 (diff)
downloadrails-efbd62f0c5c927a08e860b318b7bb561b2602a98.tar.gz
rails-efbd62f0c5c927a08e860b318b7bb561b2602a98.tar.bz2
rails-efbd62f0c5c927a08e860b318b7bb561b2602a98.zip
Corrected ActiveSupport `time_with_zone` outputs [ci skip]
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/time_with_zone.rb14
1 files changed, 7 insertions, 7 deletions
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