Adjust the server time format with the client one in ClientGuide

Server and client request/responce time format differs, since
std::chrono::time_point::time_since_epoch() output contains
undeterminated units. Make the explicit conversion to milliseconds,
to align the time format between server and client.

Pick-to: 6.8 6.9
Change-Id: I5914221d3b3b8043721f4d97705ccb54c679be9c
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
This commit is contained in:
Alexey Edelev 2025-02-22 15:09:06 +01:00
parent cb35d20adb
commit 5470136c6b
1 changed files with 3 additions and 1 deletions

View File

@ -20,7 +20,9 @@ namespace {
int64_t now()
{
return std::chrono::system_clock::now().time_since_epoch().count();
return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now()
.time_since_epoch())
.count();
}
std::ostream &operator<<(std::ostream &stream, const Request &request)