#include <tpk_manifest_handlers/watch_application_handler.h>
#include <tpk_manifest_handlers/widget_application_handler.h>
-#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "common/utils/pkgmgr_query.h"
#include "common/step/step.h"
#include "common/utils/glist_range.h"
+#include "common/utils/time_util.h"
namespace app_keys = tpk::application_keys;
namespace bf = boost::filesystem;
bool StepParseManifest::FillInstallationInfo(manifest_x* manifest) {
manifest->root_path = strdup(
(context_->root_application_path.get() / manifest->package).c_str());
- manifest->installed_time =
- strdup(std::to_string(std::chrono::system_clock::to_time_t(
- std::chrono::system_clock::now())).c_str());
+ manifest->installed_time = strdup(GetCurrentTime().c_str());
return true;
}
--- /dev/null
+// Copyright (c) 2023 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a apache 2.0 license that can be
+// found in the LICENSE file.
+
+#include "common/utils/time_util.h"
+
+#include <chrono>
+#include <string>
+
+namespace common_installer {
+
+std::string GetCurrentTime() {
+ return std::to_string(std::chrono::duration_cast<std::chrono::seconds>(
+ std::chrono::system_clock::now().time_since_epoch()).count());
+}
+
+} // namespace common_installer
--- /dev/null
+// Copyright (c) 2023 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a apache 2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef COMMON_UTILS_TIME_UTIL_H_
+#define COMMON_UTILS_TIME_UTIL_H_
+
+#include <string>
+
+namespace common_installer {
+
+std::string GetCurrentTime();
+
+} // namespace common_installer
+
+#endif // COMMON_UTILS_TIME_UTIL_H_