-
Notifications
You must be signed in to change notification settings - Fork 69
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
cron_next with time_t parameter produces next time in the past #23
Comments
Can you please provide a minimal example with what you have, and result you get and what you expect? |
Sure. Here is my test function:
and I added some debug into cron_next:
when running, I get:
my input and expected output are:
Is this clear enough? To me it looks like a wrong conversion is made between unixtime and localized time. |
Well, everything is fixed if I add a call to tzset(); right after setenv("TZ", timezone.c_str(), 1);
|
Hi, I'm trying to use croncpp and it looks very good. The only issue I see is with time_t input and timezone.
For example if I call setenv to use TZ as Europe/Rome, then I call the time_t function with current timestamp, a cron string like "*/5 * * * * *" gives a next_time in the past.
The problem is that the function takes a UTC time_t as input and then converts it as if it was a local time.
The text was updated successfully, but these errors were encountered: