floraison / fugit

time tools (cron, parsing, durations, ...) for Ruby, rufus-scheduler, and flor
MIT License
355 stars 29 forks source link

cron time + DST trouble #48

Closed grosser closed 3 years ago

grosser commented 3 years ago

I'm using Fugit.parse('55 6 * * 2#1 America/Los_Angeles') for a monthly alert. This has been alerting fine at 6:55 all the time, but 2020-12-01 it alerted 1 hour early (5:55). Last time it alerted Nov 3 at 6:55 AM which was in DST already, so I'd have expected that to fail and not the December one, but there is a chance it was scheduled before DST kicked in. I reproduced the issue using Timecop.travel('2020-11-30') and Fugit.parse('55 6 * * 2#1 America/Los_Angeles').next_time.to_debug_s and it looks like the timezone is wrong:

Timecop.travel('2020-11-30')
# => 2020-11-30 00:00:00 -0800
Fugit.parse('55 6 * * 2#1 America/Los_Angeles').next_time.to_s
# => "2020-12-01 07:55:00 -0700" <-- wrong ?
Time.now
# => 2020-11-30 00:09:15 -0800
jmettraux commented 3 years ago

Hello,

quick question, what version of fugit are you using?

grosser commented 3 years ago

1.3.3 .... update all my gems, but results were the same, will deploy that and see if the alert comes early again

jmettraux commented 3 years ago

Thanks.

1.3.9 has a change in the way it deals with DST transition, hence my question. I will test on 1.4.1.

grosser commented 3 years ago

sounds like the bug I saw, I'll report back in a month if it reproduces :)

On Tue, Dec 1, 2020 at 1:42 PM John Mettraux notifications@github.com wrote:

Thanks.

1.3.9 has a change in the way it deals with DST transition, hence my question. I will test on 1.4.1.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/floraison/fugit/issues/48#issuecomment-736838419, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAACYZYZARDKNGWN33WFKRDSSVPKRANCNFSM4UJLG7XQ .

jmettraux commented 3 years ago

Could you please give me the output of

uname -a
bundle exec ruby -v
bundle exec ruby -e "p [ :env_tz, ENV['TZ'] ]"
bundle exec ruby -r et-orbi -e "EtOrbi._make_info"
bundle exec ruby -r fugit -e "p Fugit::VERSION"

on your system?

Thanks in advance.

grosser commented 3 years ago

don't work on this, good chance it's done ... will report back if it's not :)