diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-07 11:10:03 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-07 11:10:03 +0000 |
commit | da6229a3a0a538aabcd0c209b1f751d0582d8ba3 (patch) | |
tree | e4b703337631566fdd75fbe6cee30b3bd83bd3d5 /lib | |
parent | 5ec7e5aae8e753e460ffbaa8f7c96e1a1c40430e (diff) | |
download | ruby-da6229a3a0a538aabcd0c209b1f751d0582d8ba3.tar.gz |
* lib/time.rb (Time.strptime): Use :offset.
Patch by Felipe Contreras. [ruby-core:57694]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/time.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/time.rb b/lib/time.rb index 91b5b54fe9..4474f275be 100644 --- a/lib/time.rb +++ b/lib/time.rb @@ -393,7 +393,8 @@ class Time d = Date._strptime(date, format) raise ArgumentError, "invalid strptime format - `#{format}'" unless d if seconds = d[:seconds] - Time.at(seconds) + offset = d[:offset] || 0 + Time.at(seconds).localtime(offset) else year = d[:year] year = yield(year) if year && block_given? |