aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-10-10 17:16:58 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-10-10 17:16:58 -0300
commit1d8d3b37c1bc759e0da8c24625ec0ea68c5d6d62 (patch)
tree5fd48c89902a047f764f3a557f67be1a266d4169 /activesupport
parentefbd62f0c5c927a08e860b318b7bb561b2602a98 (diff)
downloadrails-1d8d3b37c1bc759e0da8c24625ec0ea68c5d6d62.tar.gz
rails-1d8d3b37c1bc759e0da8c24625ec0ea68c5d6d62.tar.bz2
rails-1d8d3b37c1bc759e0da8c24625ec0ea68c5d6d62.zip
Revert "Corrected ActiveSupport `time_with_zone` outputs [ci skip]"
This reverts commit efbd62f0c5c927a08e860b318b7bb561b2602a98. Right now Eastern Time zone is on daylight saving, so the output in the documentation is different but this doesn't mean that it is wrong. Daylight savings only happen in 3 months in a year so it is better to use the normal time zone in the documentation.
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 d571bbd51c..3592dcba39 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) # => "-04:00"
- # Time.zone.now.formatted_offset(false) # => "-0400"
+ # Time.zone.now.formatted_offset(true) # => "-05:00"
+ # Time.zone.now.formatted_offset(false) # => "-0500"
# 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 # => "EDT"
+ # Time.zone.now.zone # => "EST"
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 EDT -04:00"
+ # Time.zone.now.inspect # => "Thu, 04 Dec 2014 11:00:25 EST -05: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-04:00"
+ # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-05: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 EDT -04:00
- # now - 1000 # => Sun, 02 Nov 2014 01:09:48 EDT -04:00
+ # 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
#
# If subtracting a Duration of variable length (i.e., years, months, days),
# move backward from #time, otherwise move backward from #utc, for accuracy