Atlas - time.cpp

Home / usr / net / Pulse / src Lines: 1 | Size: 391 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
1#include <chrono> 2#include <ctime> 3#include <string> 4 5/** 6 * Time for the logging 7 */ 8std::string get_current_timestamp() { 9 auto now = std::chrono::system_clock::now(); 10 std::time_t tt = std::chrono::system_clock::to_time_t(now); 11 12 std::tm* ptm = std::localtime(&tt); 13 14 char buffer[20]; 15 std::strftime(buffer, 20, "%Y-%m-%d %H:%M:%S", ptm); 16 return std::string(buffer); 17} 18
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.