-
Notifications
You must be signed in to change notification settings - Fork 38
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
Strange behaviour with DST? #53
Comments
Hello, thanks for the report. I am working on it. As a workaround, you could use Lines 265 to 288 in 49b6670
I think I am guilty of interpreting Now, I still have to double-check, the entrance into DST is done at 02:00, it should make a 00:00 schedule skip. |
Interpret as "Every Monday at 00:00" Embrace the mistake :-( for now
Hello, could you please tell me if the above fix suits you? If yes, I will release 1.4.3. require 'fugit'
ENV['TZ'] = 'Europe/Zurich'
t0 = Time.parse('2021-03-22 13:00')
p Fugit.parse('every monday at midnight').next_time(t0).to_s
# ==> "2021-03-29 00:00:00 +0200"
# and not "2021-04-05 00:00:00 +0200" Best regards. |
Good morning @jmettraux Many thanks for the quick reaction. I tested the master branch with our test and now it works. I think you can release 1.4.3. Best regards, Andy |
It's released https://rubygems.org/gems/fugit/versions/1.4.3 Thanks again! |
Hello, for the sake of completeness, I added a spec for when leaving the DST (October) and it failed. I have fixed the problem and released 1.4.4. 550e571 Please upgrade before October. Best regards. |
Issue description
First of all, I'm based in Switzerland. Our clock will change next week to summer time. We use Fugit in a project to allow users schedule background jobs. We have a test suite that has a test where a job should run each week with the instruction
every monday at midnight
. We compare the result of Fugit with an expected value to make sure our scheduler works.Now, instructing Fugit to give the next date for said schedule strangely gives a date in two weeks instead of next week. Other hours seem to work fine:
I'm not sure if it is related to DST and if this is supposed to happen (I don't know cron too well).
How to reproduce
See above.
Error and error backtrace (if any)
Not needed, as no error will be printed.
Expected behaviour
next_time
should printMon, 29 Mar 2021 00:00:00 CEST +02:00
.Context
Please replace the content of this section with the output of the following commands:
(It's supposed to look like
)
The text was updated successfully, but these errors were encountered: