summaryrefslogtreecommitdiff
path: root/lib/time.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/time.rb')
-rw-r--r--lib/time.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/time.rb b/lib/time.rb
index 977010087e..12c2b30e25 100644
--- a/lib/time.rb
+++ b/lib/time.rb
@@ -393,7 +393,11 @@ class Time
d = Date._strptime(date, format)
raise ArgumentError, "invalid strptime format - `#{format}'" unless d
if seconds = d[:seconds]
- Time.at(seconds)
+ if offset = d[:offset]
+ Time.at(seconds).localtime(offset)
+ else
+ Time.at(seconds)
+ end
else
year = d[:year]
year = yield(year) if year && block_given?