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:
time_t tm();
ostringstream sout;
sout << tm << ends;
In this case I get the current date/time written out as a number without any formatting. I can use
c- runtime function strftime
to format tm first, but that seems like it should not be necessary if the stl has a time class that can be instantiated from time_t value
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…