Progress into understanding time

This commit is contained in:
theskywinds 2025-06-20 16:16:19 +02:00
parent f73357ee9d
commit 362915a2f3

View File

@ -14,13 +14,15 @@ int main(int argc, char **argv) {
auto fmt = std::make_shared<MyFormatter>(); auto fmt = std::make_shared<MyFormatter>();
app.formatter(fmt); app.formatter(fmt);
// Define options
int p = 0; int p = 0;
app.add_option("-p", p, "Parameter"); app.add_option("-p", p, "Parameter");
CLI11_PARSE(app, argc, argv); CLI11_PARSE(app, argc, argv);
[[maybe_unused]] std::time_t result = std::time(nullptr);
std::tm time = *std::localtime(&result);
std::cout << std::asctime(&time);
std::cout << "Parameter value: " << p << std::endl; std::cout << "Parameter value: " << p << std::endl;
return 0; return 0;
} }