I wrote a function to get a current date and time in format: DD-MM-YYYY HH:MM:SS. It works but let\'s say, its pretty ugly. How can I do exactly the sam
DD-MM-YYYY HH:MM:SS
Using C++ in MS Visual Studio 2015 (14), I use:
#include string NowToString() { chrono::system_clock::time_point p = chrono::system_clock::now(); time_t t = chrono::system_clock::to_time_t(p); char str[26]; ctime_s(str, sizeof str, &t); return str; }