1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #21552 from ronakjangir47/fixed_docs

Fixed Time conversion example for UTC time zone [ci skip]
This commit is contained in:
Richard Schneeman 2015-09-08 11:46:42 -05:00
commit 0c66326124

View file

@ -14,7 +14,7 @@ class String
# "06:12".to_time # => 2012-12-13 06:12:00 +0100 # "06:12".to_time # => 2012-12-13 06:12:00 +0100
# "2012-12-13 06:12".to_time # => 2012-12-13 06:12:00 +0100 # "2012-12-13 06:12".to_time # => 2012-12-13 06:12:00 +0100
# "2012-12-13T06:12".to_time # => 2012-12-13 06:12:00 +0100 # "2012-12-13T06:12".to_time # => 2012-12-13 06:12:00 +0100
# "2012-12-13T06:12".to_time(:utc) # => 2012-12-13 05:12:00 UTC # "2012-12-13T06:12".to_time(:utc) # => 2012-12-13 06:12:00 UTC
# "12/13/2012".to_time # => ArgumentError: argument out of range # "12/13/2012".to_time # => ArgumentError: argument out of range
def to_time(form = :local) def to_time(form = :local)
parts = Date._parse(self, false) parts = Date._parse(self, false)