summaryrefslogtreecommitdiff
path: root/http/utility.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-01-26 23:19:54 +0300
committerEd Tanous <ed@tanous.net>2022-02-04 01:11:33 +0300
commitc419c759177f7d42af4848bc9d16bca3c1644387 (patch)
tree92273298d3b5b564b90d5ea646f98c1a30b6136b /http/utility.hpp
parent67df073b1f0950fdeafc6d30240d360bd162d0f8 (diff)
downloadbmcweb-c419c759177f7d42af4848bc9d16bca3c1644387.tar.xz
Remove getTimestamp
The aforementioned function is only used in the log services, and is used incorrectly in that context. This commit replaces it with the correct (and unit tested) getDateTimeUintMs, which is what we should be using for dbus->time conversions in all cases, to avoid time_t overflows when static casting. Tested: Before "Created": "2022-01-31T19:39:58+00:00", "Modified": "2022-01-31T19:39:58+00:00", With change: "Created": "2022-01-31T19:39:58.101000+00:00", "Modified": "2022-01-31T19:39:58.101000+00:00", The Redfish validator is okay with this *** /redfish/v1/Systems/system/LogServices/EventLog/Entries/1000 Type (LogEntry.v1_8_0.LogEntry), GET SUCCESS (time: 0) PASS Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ie8a2243230ee080d9e8785ae918fad1b1b6ab145
Diffstat (limited to 'http/utility.hpp')
-rw-r--r--http/utility.hpp10
1 files changed, 0 insertions, 10 deletions
diff --git a/http/utility.hpp b/http/utility.hpp
index 62a4eb0f44..749da9bc51 100644
--- a/http/utility.hpp
+++ b/http/utility.hpp
@@ -671,15 +671,5 @@ struct ConstantTimeCompare
}
};
-inline std::time_t getTimestamp(uint64_t millisTimeStamp)
-{
- // Retrieve Created property with format:
- // yyyy-mm-ddThh:mm:ss
- std::chrono::milliseconds chronoTimeStamp(millisTimeStamp);
- return std::chrono::duration_cast<std::chrono::duration<int>>(
- chronoTimeStamp)
- .count();
-}
-
} // namespace utility
} // namespace crow