diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-09 05:55:29 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-09 05:55:29 +0000 |
commit | 7f9089a1864f3381fae8e7a08b9c225c4e4ed34a (patch) | |
tree | a45dc490a6586017ef47cbe089935d56f39e0c5d /lib/time.rb | |
parent | 97fffcadcb45c26c988d893c992072163d9f03b3 (diff) |
Time.parse based from non-Time object
* lib/time.rb (Time.make_time): as the document states, the second
argument of `Time.parse` may be a non-`Time` object which does not
have `getlocal` method, assume it is in the local time in the case.
based on the patch by nkmrya (Yasuhiro Nakamura) at
[ruby-core:68775]. [ruby-core:68775] [Bug #11037]
Co-authored-by: nkmrya (Yasuhiro Nakamura) <yasuhiro6194@gmail.com>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/time.rb')
-rw-r--r-- | lib/time.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/time.rb b/lib/time.rb index 0bfd9a9a45..a2ada7728b 100644 --- a/lib/time.rb +++ b/lib/time.rb @@ -267,7 +267,7 @@ class Time return make_time(date, year, nil, mon, day, hour, min, sec, sec_fraction, zone, now) end - if now + if now and now.respond_to?(:getlocal) if off now = now.getlocal(off) if now.utc_offset != off else |