-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timezone ignored in cron.match? #21
Comments
Sorry, what version of Ruby on what Operating System are you using? On my ruby 2.3.7p456 (2018-03-28 revision 63024) [x86_64-darwin17] Time.new(2019, 1, 1, 0, 0, 0, TZInfo::Timezone.get('UTC'))
# ==> TypeError: can't convert TZInfo::DataTimezone into an exact number |
its |
OK, I'll look into this (from the Ruby < 2.6 point of view for now) require 'fugit'
cron = Fugit::Cron.parse("0 0 * * * PST8PDT")
p cron
# => #<Fugit::Cron:0x00007fb3b8bdf880
# @original="0 0 * * * PST8PDT", @cron_s=nil, @seconds=[0],
# @minutes=[0], @hours=[0], @monthdays=nil, @months=nil, @weekdays=nil,
# @zone="PST8PDT", @timezone=#<TZInfo::DataTimezone: PST8PDT>>
#p cron.match?(Time.utc(2019, 1, 1, 0, 0, 0))
p cron.match?(EtOrbi.parse('2019-1-1'))
# => true
#p cron.match?(Time.new(2019, 1, 1, 0, 0, 0, TZInfo::Timezone.get('UTC')))
p cron.match?(EtOrbi.parse('2019-1-1 UTC'))
# => true
#p cron.match?(Time.new(2019, 1, 1, 0, 0, 0, TZInfo::Timezone.get('CET')))
p cron.match?(EtOrbi.parse('2019-1-1 ETC'))
# => true
#p cron.match?(Time.new(2019, 1, 1, 0, 0, 0, TZInfo::Timezone.get('PST8PDT')))
p cron.match?(EtOrbi.parse('2019-1-1 PST8PDT'))
# => true |
Closing, moved to floraison/fugit#31 Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Timezone seems to be completely irrelevant when calling
match?
on cron object:I thought setting timezone in cron would make it only match in specific time zone. In example above i'd expect it to match only in PST8PDT midnight.
The text was updated successfully, but these errors were encountered: