133 const std::time_t time = std::chrono::system_clock::to_time_t(timePoint);
134 std::tm* tm_ptr = std::gmtime(&time);
137 std::string onlineSince =
"Formatting error";
140 if (std::strftime(buffer,
sizeof(buffer),
"%Y-%m-%d %H:%M:%S", tm_ptr) > 0) {
141 onlineSince = std::string(buffer) +
" UTC";
148 const std::chrono::time_point<std::chrono::system_clock>& later) {
149 using seconds_duration_type = std::chrono::duration<std::chrono::seconds::rep>::rep;
151 const seconds_duration_type totalSeconds = std::chrono::duration_cast<std::chrono::seconds>(later - bevore).count();
154 const seconds_duration_type days = totalSeconds / 86400;
155 seconds_duration_type remainder = totalSeconds % 86400;
156 const seconds_duration_type hours = remainder / 3600;
157 remainder = remainder % 3600;
158 const seconds_duration_type minutes = remainder / 60;
159 const seconds_duration_type seconds = remainder % 60;
162 std::ostringstream oss;
164 oss << days <<
" day" << (days == 1 ?
"" :
"s") <<
", ";
166 oss << std::setw(2) << std::setfill(
'0') << hours <<
":" << std::setw(2) << std::setfill(
'0') << minutes <<
":" << std::setw(2)
167 << std::setfill(
'0') << seconds;
virtual core::socket::stream::SocketContext * create(core::socket::stream::SocketConnection *socketConnection)=0