Move time utils to be in one place
We've accumulated several time utility functions in the http classes.
Time isn't a core HTTP primitive, so http is not where those functions
below.
This commit moves all the time functions from the crow::utility
namespace into the redfish::time_utils namespace, as well as moves the
unit tests.
No code changes where made to the individual functions, with the
exception of changing the namespace on the unit tests.
Tested: Unit tests pass.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I8493375f60aea31899c84ae703e0f71a17dbdb73
diff --git a/redfish-core/lib/task.hpp b/redfish-core/lib/task.hpp
index 7d96e42..be48a5b 100644
--- a/redfish-core/lib/task.hpp
+++ b/redfish-core/lib/task.hpp
@@ -395,11 +395,11 @@
asyncResp->res.jsonValue["Name"] = "Task " + strParam;
asyncResp->res.jsonValue["TaskState"] = ptr->state;
asyncResp->res.jsonValue["StartTime"] =
- crow::utility::getDateTimeStdtime(ptr->startTime);
+ redfish::time_utils::getDateTimeStdtime(ptr->startTime);
if (ptr->endTime)
{
asyncResp->res.jsonValue["EndTime"] =
- crow::utility::getDateTimeStdtime(*(ptr->endTime));
+ redfish::time_utils::getDateTimeStdtime(*(ptr->endTime));
}
asyncResp->res.jsonValue["TaskStatus"] = ptr->status;
asyncResp->res.jsonValue["Messages"] = ptr->messages;
@@ -473,7 +473,7 @@
asyncResp->res.jsonValue["Name"] = "Task Service";
asyncResp->res.jsonValue["Id"] = "TaskService";
asyncResp->res.jsonValue["DateTime"] =
- crow::utility::getDateTimeOffsetNow().first;
+ redfish::time_utils::getDateTimeOffsetNow().first;
asyncResp->res.jsonValue["CompletedTaskOverWritePolicy"] = "Oldest";
asyncResp->res.jsonValue["LifeCycleEventOnTaskStateChange"] = true;