class Object
Public Instance Methods
local_to_utc(time_string, zone:)
click to toggle source
Use local_to_utc
helper to setup execution time using your local timezone instead of server's timezone (which is probably and should be UTC, to check run `$ timedatectl`). Also maybe you'll want to set same timezone in kimurai as well (use `Kimurai.configuration.time_zone =` for that), to have spiders logs in a specific time zone format. Example usage of helper: every 1.day, at: local_to_utc
(“7:00”, zone: “Europe/Moscow”) do
crawl "google_spider.com", output: "log/google_spider.com.log"
end
# File lib/kimurai/template/config/schedule.rb, line 18 def local_to_utc(time_string, zone:) TZInfo::Timezone.get(zone).local_to_utc(Time.parse(time_string)) end