MCPcopy Create free account
hub / github.com/ReversecLabs/C3 / GetCurrentTimestamp

Function GetCurrentTimestamp

Src/Core/BackendCommons.cpp:122–137  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

120
121////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
122std::string GetCurrentTimestamp()
123{
124
125 std::time_t now = std::time(nullptr);
126 std::tm timeInfo{};
127
128 // Convert to local time safely
129 if (localtime_s(&timeInfo, &now) != 0)
130 return "[Invalid Time] ";
131
132 char buf[32]; // Format: [YYYY-MM-DD HH:MM:SS]
133 if (std::strftime(buf, sizeof(buf), "[%Y-%m-%d %H:%M:%S] ", &timeInfo) == 0)
134 return "[Time Format Error] ";
135
136 return std::string(buf);
137}
138
139////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
140std::string FSecure::C3::Utils::ConvertLogMessageToConsoleText(std::string_view relayName, LogMessage const& message, std::string_view sender)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected