#include "common.h" #include #include #include /** * @brief GetCurrentTime 获取当前时间 * @return */ std::string getCurrentTimeString() { std::time_t t = std::time(NULL); char mbstr[100]; std::strftime(mbstr, sizeof(mbstr), "%Y-%m-%d %H:%M:%S", std::localtime(&t)); std::string strTime = mbstr; return strTime; } std::string getCurrentShortTimeString() { std::time_t t = std::time(NULL); char mbstr[100]; std::strftime(mbstr, sizeof(mbstr), "%H:%M:%S", std::localtime(&t)); std::string strTime = mbstr; return strTime; }