diff --git a/cache.h b/cache.h index c869e3a..04e36e6 100644 --- a/cache.h +++ b/cache.h @@ -52,6 +52,10 @@ public: std::string owner; std::string owner_uuid; std::tm date_found; + std::string year; + std::string mon; + std::string day; + std::string hour; static Position home; diff --git a/okapi.cpp b/okapi.cpp index c08c1cc..9624230 100644 --- a/okapi.cpp +++ b/okapi.cpp @@ -105,6 +105,7 @@ std::string Okapi::get_caches_json(std::string codes) { Caches Okapi::get_caches(std::vector> codes) { Cache c; Caches cc; + char month[20]; uint n = 0; while (n < codes.size()) { @@ -135,6 +136,11 @@ Caches Okapi::get_caches(std::vector> codes) { for (auto& el2 : codes) { if (el2.first == c.code) { c.date_found = el2.second; + c.year = std::to_string(el2.second.tm_year); + std::strftime(month, 20, "%B", &el2.second); + c.mon = month; + c.day = std::to_string(el2.second.tm_mday); + c.hour = std::to_string(el2.second.tm_hour); break; } }