tdf#107038 Poco::Timestamp replacement with std::chrono

Replaced Poco::DateTimeFormatter with Util::getHttpTimeNow

Change-Id: I1a8591a434140270929406386218d08c71a888cc
Reviewed-on: https://gerrit.libreoffice.org/78700
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
diff --git a/net/Socket.cpp b/net/Socket.cpp
index cb50434..f5661c3 100644
--- a/net/Socket.cpp
+++ b/net/Socket.cpp
@@ -415,7 +415,7 @@
void StreamSocket::send(Poco::Net::HTTPResponse& response)
{
    response.set("User-Agent", HTTP_AGENT_STRING);
    response.set("Date", Poco::DateTimeFormatter::format(Poco::Timestamp(), Poco::DateTimeFormat::HTTP_FORMAT));
    response.set("Date", Util::getHttpTimeNow());

    std::ostringstream oss;
    response.write(oss);
diff --git a/tools/WebSocketDump.cpp b/tools/WebSocketDump.cpp
index 39212b7..e7fe148 100644
--- a/tools/WebSocketDump.cpp
+++ b/tools/WebSocketDump.cpp
@@ -161,7 +161,7 @@
            // Bad request.
            std::ostringstream oss;
            oss << "HTTP/1.1 400\r\n"
                << "Date: " << Poco::DateTimeFormatter::format(Poco::Timestamp(), Poco::DateTimeFormat::HTTP_FORMAT) << "\r\n"
                << "Date: " << Util::getHttpTimeNow() << "\r\n"
                << "User-Agent: LOOLWSD WOPI Agent\r\n"
                << "Content-Length: 0\r\n"
                << "\r\n";
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 5a1dbce..f84a732 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2438,7 +2438,7 @@
            // Bad request.
            std::ostringstream oss;
            oss << "HTTP/1.1 400\r\n"
                << "Date: " << Poco::DateTimeFormatter::format(Poco::Timestamp(), Poco::DateTimeFormat::HTTP_FORMAT) << "\r\n"
                << "Date: " << Util::getHttpTimeNow() << "\r\n"
                << "User-Agent: LOOLWSD WOPI Agent\r\n"
                << "Content-Length: 0\r\n"
                << "\r\n"
@@ -2740,7 +2740,7 @@
                LOG_ERR("Download file [" << filePathAnonym << "] not found.");
                std::ostringstream oss;
                oss << "HTTP/1.1 404 Not Found\r\n"
                    << "Date: " << Poco::DateTimeFormatter::format(Poco::Timestamp(), Poco::DateTimeFormat::HTTP_FORMAT) << "\r\n"
                    << "Date: " << Util::getHttpTimeNow() << "\r\n"
                    << "User-Agent: " << HTTP_AGENT_STRING << "\r\n"
                    << "Content-Length: 0\r\n"
                    << "\r\n";
diff --git a/wsd/TraceFile.hpp b/wsd/TraceFile.hpp
index 5f3ac72..82f5a75 100644
--- a/wsd/TraceFile.hpp
+++ b/wsd/TraceFile.hpp
@@ -91,7 +91,8 @@
                    const bool compress,
                    const bool takeSnapshot,
                    const std::vector<std::string>& filters) :
        _epochStart(Poco::Timestamp().epochMicroseconds()),
        _epochStart(std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now()
                                                            .time_since_epoch()).count()),
        _recordOutgoing(recordOugoing),
        _compress(compress),
        _takeSnapshot(takeSnapshot),
@@ -258,7 +259,8 @@
    {
        Util::assertIsLocked(_mutex);

        const Poco::Int64 usec = Poco::Timestamp().epochMicroseconds() - _epochStart;
        const Poco::Int64 usec = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono
                                        ::system_clock::now().time_since_epoch()).count() - _epochStart;
        if (_compress)
        {
            _deflater.write(&delim, 1);