aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authoramitkumarsuroliya <amitkumarsuroliya@gmail.com>2015-09-20 17:59:22 +0530
committeramitkumarsuroliya <amitkumarsuroliya@gmail.com>2015-09-20 18:01:26 +0530
commita2f78cb947c8f25bcb450e548c77040b5d1c1f04 (patch)
tree782850df27ee9b720e1befeb05b0fb9fc2f4d38e /guides/source
parente299b515ca62eeb9f9d159d4489ea42782cdd7aa (diff)
downloadrails-a2f78cb947c8f25bcb450e548c77040b5d1c1f04.tar.gz
rails-a2f78cb947c8f25bcb450e548c77040b5d1c1f04.tar.bz2
rails-a2f78cb947c8f25bcb450e548c77040b5d1c1f04.zip
fix `to_time` output in ActiveSupport guide. Since https://github.com/rails/rails/commit/48583f8bf74d1cefefea3cd6591bd546a9eaff6c , to_time returns times formatted as YYYY-MM-DD HH:MM:SS UTC [ci skip]
`to_time` method returns in `YYYY-MM-DD HH:MM:SS UTC` format after this commit https://github.com/rails/rails/commit/48583f8bf74d1cefefea3cd6591bd546a9eaff6c .
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/active_support_core_extensions.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md
index 01bf928407..367a1bf7c0 100644
--- a/guides/source/active_support_core_extensions.md
+++ b/guides/source/active_support_core_extensions.md
@@ -1865,15 +1865,15 @@ The methods `to_date`, `to_time`, and `to_datetime` are basically convenience wr
```ruby
"2010-07-27".to_date # => Tue, 27 Jul 2010
-"2010-07-27 23:37:00".to_time # => Tue Jul 27 23:37:00 UTC 2010
+"2010-07-27 23:37:00".to_time # => 2010-07-27 23:37:00 +0200
"2010-07-27 23:37:00".to_datetime # => Tue, 27 Jul 2010 23:37:00 +0000
```
`to_time` receives an optional argument `:utc` or `:local`, to indicate which time zone you want the time in:
```ruby
-"2010-07-27 23:42:00".to_time(:utc) # => Tue Jul 27 23:42:00 UTC 2010
-"2010-07-27 23:42:00".to_time(:local) # => Tue Jul 27 23:42:00 +0200 2010
+"2010-07-27 23:42:00".to_time(:utc) # => 2010-07-27 23:42:00 UTC
+"2010-07-27 23:42:00".to_time(:local) # => 2010-07-27 23:42:00 +0200
```
Default is `:utc`.