diff --git a/lib/crono/period.rb b/lib/crono/period.rb index 75c3309..3c7a436 100644 --- a/lib/crono/period.rb +++ b/lib/crono/period.rb @@ -31,7 +31,7 @@ module Crono def description desc = "every #{@period.inspect}" - desc += " between #{@interval.from} and #{@interval.to}" if @interval + desc += " between #{@interval.from} and #{@interval.to} UTC" if @interval desc += format(' at %.2i:%.2i', @at_hour, @at_min) if @at_hour && @at_min desc += " on #{DAYS[@on].capitalize}" if @on desc diff --git a/lib/crono/time_of_day.rb b/lib/crono/time_of_day.rb index 3244bbc..63c541d 100644 --- a/lib/crono/time_of_day.rb +++ b/lib/crono/time_of_day.rb @@ -6,17 +6,15 @@ module Crono attr_accessor :hour, :min def self.parse(value) - case value - when String - time = Time.parse(value) - new time.hour, time.min - when Hash - new value[:hour], value[:min] - when Time - new value.hour, value.min - else - fail "Unknown TimeOfDay format: #{value.inspect}" - end + time = + case value + when String then Time.parse(value).utc + when Hash then Time.now.change(value).utc + when Time then value.utc + else + fail "Unknown TimeOfDay format: #{value.inspect}" + end + new time.hour, time.min end def initialize(hour, min)