mariusbancila / croncpp

A C++11/14/17 header-only cross-platform library for handling CRON expressions
MIT License
230 stars 68 forks source link

Daylight saving issue #8

Open Edgaras-Randis opened 5 years ago

Edgaras-Randis commented 5 years ago

unix epoch time: 1585398600 Saturday, March 28, 2020 2:30:00 PM GMT+02:00

rule: 0 30 14 *

using that time, next time returns the same time, it's probably related with the daylight time saving of next day change.

mariusbancila commented 2 years ago

This code fails:

time_t now = 1585398600;    // Saturday, March 28, 2020 2:30:00 PM GMT+02:00
std::string expr = "0 30 14 * * *";
cron::cronexpr exp = cron::make_cron(expr);
time_t next = cron::cron_next(exp, now);

REQUIRE(next > now);