MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / get_current_time_string

Function get_current_time_string

src/server/server.cpp:26–32  ·  view source on GitHub ↗

@brief get current time string, format: hh:mm:ss mm:dd:yyyy @return the current time string

Source from the content-addressed store, hash-verified

24///@brief get current time string, format: hh:mm:ss mm:dd:yyyy
25///@return the current time string
26std::string get_current_time_string() {
27 auto now = std::chrono::system_clock::now();
28 auto in_time_t = std::chrono::system_clock::to_time_t(now);
29 std::stringstream ss;
30 ss << std::put_time(std::localtime(&in_time_t), "%H:%M:%S %m:%d:%Y");
31 return ss.str();
32}
33
34// Helper: Truncate a UTF-8 string by code points, not bytes
35std::string utf8_truncate_middle(const std::string& input, size_t head_count, size_t tail_count) {

Callers 1

handle_requestMethod · 0.85

Calls 1

nowFunction · 0.85

Tested by

no test coverage detected