common: modernize getCurrentSystemTime() API

Leverage `std::format` from c++20, which provides a more concise and
readable way to format strings compared to `std::stringstream`. Also use
zoned time from c++20 chrono, which makes the API to handle different
time zones if needed & is more accurate.

Tested :
Before the fix the API returns: 2024-04-24 UTC 05:19:00.533100
With this patch the API returns: 2024-04-24 UTC 05:19:00.533266342

Change-Id: Ida3ae3bdd8901422303a1812a30346d19f6bb5cb
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
diff --git a/common/utils.cpp b/common/utils.cpp
index 6193817..9eed1be 100644
--- a/common/utils.cpp
+++ b/common/utils.cpp
@@ -776,16 +776,9 @@
 
 std::string getCurrentSystemTime()
 {
-    using namespace std::chrono;
-    const time_point<system_clock> tp = system_clock::now();
-    std::time_t tt = system_clock::to_time_t(tp);
-    auto ms = duration_cast<microseconds>(tp.time_since_epoch()) -
-              duration_cast<seconds>(tp.time_since_epoch());
-
-    std::stringstream ss;
-    ss << std::put_time(std::localtime(&tt), "%F %Z %T.")
-       << std::to_string(ms.count());
-    return ss.str();
+    const auto zonedTime{std::chrono::zoned_time{
+        std::chrono::current_zone(), std::chrono::system_clock::now()}};
+    return std::format("{:%F %Z %T}", zonedTime);
 }
 
 bool checkForFruPresence(const std::string& objPath)