Use date utilities from libyang-cpp
Unfortunately, our CI still does not have std::chrono implementation
we need in order to not require the date lib.
Also change date timezones from -00:00 to local timezone.
Depends-on: https://gerrit.cesnet.cz/c/CzechLight/dependencies/+/7234
Change-Id: If0ca8fc049a9a3b41853144f5c3b81532b0e349d
diff --git a/src/system/Authentication.cpp b/src/system/Authentication.cpp
index 544a5d2..460e53c 100644
--- a/src/system/Authentication.cpp
+++ b/src/system/Authentication.cpp
@@ -7,6 +7,7 @@
#include <fmt/core.h>
#include <fstream>
+#include <libyang-cpp/Time.hpp>
#include <pwd.h>
#include <shadow.h>
#include <spdlog/spdlog.h>
@@ -17,7 +18,6 @@
#include "utils/io.h"
#include "utils/libyang.h"
#include "utils/sysrepo.h"
-#include "utils/time.h"
using namespace std::string_literals;
namespace {
@@ -131,8 +131,8 @@
assert(entry);
using namespace std::chrono_literals;
- using TimeType = std::chrono::time_point<std::chrono::system_clock>;
- res.emplace(entry->sp_namp, velia::utils::yangTimeFormat(TimeType(24h * entry->sp_lstchg)));
+ using TimeType = std::chrono::time_point<std::chrono::system_clock, std::chrono::seconds>;
+ res.emplace(entry->sp_namp, libyang::yangTimeFormat(TimeType(24h * entry->sp_lstchg), libyang::TimezoneInterpretation::Local));
}
return res;