From be2b4424a1a167159bd405e3f1d7a44f18579e15 Mon Sep 17 00:00:00 2001 From: Per Malmberg Date: Sun, 11 Mar 2018 19:07:35 +0100 Subject: [PATCH] Added note about UTC. --- README.md | 11 ++++++++++- test/CronScheduleTest.cpp | 17 ++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4ee1c7a..8fc295a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # libcron A C++ scheduling library using cron formatting. +# Time zones + +This library uses `std::chrono::system_clock::timepoint` as its time unit, thus all calculations are in UTC. + # Supported formatting This implementation supports cron format, as specified below. @@ -59,4 +63,9 @@ the '?'-character unless one field already is something other than '*'. | * * * * * ? | Every second |0 0 12 * * MON-FRI | Every Weekday at noon |0 0 12 1/2 * ? | Every 2 days, starting on the 1st at noon -| 0 0 */12 ? * * | Every twelve hours \ No newline at end of file +| 0 0 */12 ? * * | Every twelve hours + +# Third party libraries + +Howard Hinnant's [date.h](https://github.com/HowardHinnant/date/) + diff --git a/test/CronScheduleTest.cpp b/test/CronScheduleTest.cpp index f76f866..8115cf6 100644 --- a/test/CronScheduleTest.cpp +++ b/test/CronScheduleTest.cpp @@ -207,9 +207,24 @@ SCENARIO("Examples from README.md") DT(2018_y / 8 / 16, hours{12}), DT(2018_y / 8 / 17, hours{0}) })); - } +//SCENARIO("Daylight Savings Time") +//{ +// // In sweden when local standard time is about to reach +// //Sunday, 25 March 2018, 02:00:00 clocks are turned forward 1 hour to +// //Sunday, 25 March 2018, 03:00:00 local daylight time instead. +// +// REQUIRE(test("0 0 * * * ?", DT(2018_y / 3 / 25, hours{0}), +// { +// DT(2018_y / 3 / 25, hours{0}), +// DT(2018_y / 3 / 25, hours{1}), +// // This hour disappear! DT(2018_y / 3 / 25, hours{2}), +// DT(2018_y / 3 / 25, hours{3}), +// DT(2018_y / 3 / 25, hours{4}) +// })); +//} + SCENARIO("Unable to calculate time point") { // TODO: Find a schedule that is unsolvable.