time_t seconds; time(&seconds); cout << seconds << endl;
This gives me a timestamp. How can I get that epoch date into a string?<
The C++ way is to use stringstream.
The C way is to use snprintf() to format the number:
char buf[16]; snprintf(buf, 16, "%lu", time(NULL));