@brief get current time string, format: hh:mm:ss mm:dd:yyyy @return the current time string
| 24 | ///@brief get current time string, format: hh:mm:ss mm:dd:yyyy |
| 25 | ///@return the current time string |
| 26 | std::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 |
| 35 | std::string utf8_truncate_middle(const std::string& input, size_t head_count, size_t tail_count) { |