Skip to content

Example does appear to work/parse? #14

Description

@harlowja

I was trying some of the examples and saw the following happen:

Trying: 0 15 10 L * ?
terminate called after throwing an instance of 'cron::bad_cronexpr'
  what():  stoul
Aborted (core dumped)

Program code (nothing crazy):

#include "croncpp.h"

#include <chrono>
#include <iostream>
#include <string>

int main(int argc, char** argv) {
    std::string c = argv[1];
    std::cout << "Trying: "<< c << "\n";
    auto cexpr = cron::make_cron(c);
    auto now = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
    auto next = cron::cron_next(cexpr, now);
    std::cout << next << "\n";
    return 0;
}

I also tried with the various oracle and quartz traits, but didn't seem to work.

Perhaps remove from the README.md if this format doesn't work?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions