Does C++ stl have a standard time class? Or do I have to convert to c-string before writing to a stream. Example, I want to output the current date/time to a string stream:<
OK. Here is closest I have found about directly writing time to a stream:
time_t t(time(NULL)); // current time
tm tm(*localtime(&t));
std::locale loc(""); // current user locale
ostringstream sout;
const std::time_put &tput =
std::use_facet >(loc);
tput.put(sout.rdbuf(), sout, _T('\0'), &tm, _T('x'));
sout << ends;
CString sTest(sout.str().c_str());
A very helpful guide is the Apache C++ Standard Library Reference Guide http://stdcxx.apache.org/doc/stdlibref/time-put.html#sec13