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
diff --git a/http/utility.hpp b/http/utility.hpp
index 62a4eb0..749da9b 100644
--- a/http/utility.hpp
+++ b/http/utility.hpp
@@ -671,15 +671,5 @@
     }
 };
 
-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
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 43be44b..e20a2ba 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -1428,8 +1428,8 @@
                     for (auto& objectPath : resp)
                     {
                         const uint32_t* id = nullptr;
-                        std::time_t timestamp{};
-                        std::time_t updateTimestamp{};
+                        const uint64_t* timestamp = nullptr;
+                        const uint64_t* updateTimestamp = nullptr;
                         const std::string* severity = nullptr;
                         const std::string* message = nullptr;
                         const std::string* filePath = nullptr;
@@ -1448,28 +1448,14 @@
                                     }
                                     else if (propertyMap.first == "Timestamp")
                                     {
-                                        const uint64_t* millisTimeStamp =
-                                            std::get_if<uint64_t>(
-                                                &propertyMap.second);
-                                        if (millisTimeStamp != nullptr)
-                                        {
-                                            timestamp =
-                                                crow::utility::getTimestamp(
-                                                    *millisTimeStamp);
-                                        }
+                                        timestamp = std::get_if<uint64_t>(
+                                            &propertyMap.second);
                                     }
                                     else if (propertyMap.first ==
                                              "UpdateTimestamp")
                                     {
-                                        const uint64_t* millisTimeStamp =
-                                            std::get_if<uint64_t>(
-                                                &propertyMap.second);
-                                        if (millisTimeStamp != nullptr)
-                                        {
-                                            updateTimestamp =
-                                                crow::utility::getTimestamp(
-                                                    *millisTimeStamp);
-                                        }
+                                        updateTimestamp = std::get_if<uint64_t>(
+                                            &propertyMap.second);
                                     }
                                     else if (propertyMap.first == "Severity")
                                     {
@@ -1519,7 +1505,8 @@
                         // xyz.openbmc_project.Logging.Entry interface, ignore
                         // and continue.
                         if (id == nullptr || message == nullptr ||
-                            severity == nullptr)
+                            severity == nullptr || timestamp == nullptr ||
+                            updateTimestamp == nullptr)
                         {
                             continue;
                         }
@@ -1537,9 +1524,9 @@
                         thisEntry["Severity"] =
                             translateSeverityDbusToRedfish(*severity);
                         thisEntry["Created"] =
-                            crow::utility::getDateTimeStdtime(timestamp);
+                            crow::utility::getDateTimeUintMs(*timestamp);
                         thisEntry["Modified"] =
-                            crow::utility::getDateTimeStdtime(updateTimestamp);
+                            crow::utility::getDateTimeUintMs(*updateTimestamp);
                         if (filePath != nullptr)
                         {
                             thisEntry["AdditionalDataURI"] =
@@ -1594,8 +1581,8 @@
                             return;
                         }
                         const uint32_t* id = nullptr;
-                        std::time_t timestamp{};
-                        std::time_t updateTimestamp{};
+                        const uint64_t* timestamp = nullptr;
+                        const uint64_t* updateTimestamp = nullptr;
                         const std::string* severity = nullptr;
                         const std::string* message = nullptr;
                         const std::string* filePath = nullptr;
@@ -1609,24 +1596,13 @@
                             }
                             else if (propertyMap.first == "Timestamp")
                             {
-                                const uint64_t* millisTimeStamp =
+                                timestamp =
                                     std::get_if<uint64_t>(&propertyMap.second);
-                                if (millisTimeStamp != nullptr)
-                                {
-                                    timestamp = crow::utility::getTimestamp(
-                                        *millisTimeStamp);
-                                }
                             }
                             else if (propertyMap.first == "UpdateTimestamp")
                             {
-                                const uint64_t* millisTimeStamp =
+                                updateTimestamp =
                                     std::get_if<uint64_t>(&propertyMap.second);
-                                if (millisTimeStamp != nullptr)
-                                {
-                                    updateTimestamp =
-                                        crow::utility::getTimestamp(
-                                            *millisTimeStamp);
-                                }
                             }
                             else if (propertyMap.first == "Severity")
                             {
@@ -1656,7 +1632,8 @@
                             }
                         }
                         if (id == nullptr || message == nullptr ||
-                            severity == nullptr)
+                            severity == nullptr || timestamp == nullptr ||
+                            updateTimestamp == nullptr)
                         {
                             messages::internalError(asyncResp->res);
                             return;
@@ -1675,9 +1652,9 @@
                         asyncResp->res.jsonValue["Severity"] =
                             translateSeverityDbusToRedfish(*severity);
                         asyncResp->res.jsonValue["Created"] =
-                            crow::utility::getDateTimeStdtime(timestamp);
+                            crow::utility::getDateTimeUintMs(*timestamp);
                         asyncResp->res.jsonValue["Modified"] =
-                            crow::utility::getDateTimeStdtime(updateTimestamp);
+                            crow::utility::getDateTimeUintMs(*updateTimestamp);
                         if (filePath != nullptr)
                         {
                             asyncResp->res.jsonValue["AdditionalDataURI"] =