From 4f03aedf6891d7b99e87cda537603a7d80c9ec34 Mon Sep 17 00:00:00 2001 From: Manuel Neuhauser Date: Sat, 13 Feb 2021 18:27:17 -0500 Subject: [PATCH] Preserve the timezone of the source when returning the time object --- lib/cron_parser.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/cron_parser.rb b/lib/cron_parser.rb index 41a8a5e..712ffd9 100644 --- a/lib/cron_parser.rb +++ b/lib/cron_parser.rb @@ -15,12 +15,13 @@ def initialize(time,time_source = Time) @day = time.day @hour = time.hour @min = time.min + @gmtoff = time.gmtoff @time_source = time_source end def to_time - time_source.local(@year, @month, @day, @hour, @min, 0) + time_source.new(@year, @month, @day, @hour, @min, 0, @gmtoff) end def inspect