Drop boost::posix_time
Per the coding standard, if we can support what we need to do with
std variants of something, we should prefer that. This commit adds an
iso8160 to string method that supports any arbitrary
std::chrono::duration object, which allows doing the full range of all
of our integer types, and reduces the complexity (and presumably compile
times) not pulling in a complex library.
Despite the heavy templating, this only appears to add 108 bytes of
compressed binary size to bmcweb. This is likely due to the decreased
complexity compared to the boost variant (that likely pulls in
boost::locale). (Ie 3 template instantiations of the simple one take
about the same binary space as 1 complex instantiation).
Tested:
Unit tests pass (pretty good coverage here)
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I78200fb391b601eba8d2bfd2de0dd868e4390d6b
diff --git a/http/ut/utility_test.cpp b/http/ut/utility_test.cpp
index c774996..a1125b4 100644
--- a/http/ut/utility_test.cpp
+++ b/http/ut/utility_test.cpp
@@ -85,7 +85,7 @@
{
// some time before the epoch
EXPECT_EQ(getDateTimeStdtime(std::time_t{-1234567}),
- "1969-12-17T17:03:53+00:00");
+ "1970-01-01T00:00:00+00:00");
// epoch
EXPECT_EQ(getDateTimeStdtime(std::time_t{0}), "1970-01-01T00:00:00+00:00");
@@ -120,7 +120,7 @@
{
// returns the maximum Redfish date
EXPECT_EQ(getDateTimeUintMs(std::numeric_limits<uint64_t>::max()),
- "9999-12-31T23:59:59.999000+00:00");
+ "9999-12-31T23:59:59+00:00");
EXPECT_EQ(getDateTimeUintMs(std::numeric_limits<uint64_t>::min()),
"1970-01-01T00:00:00+00:00");
}