
On Mon, 20 Feb 2006 18:17:24 -0500, Christian Henning wrote
Not sure, if I understand you correctly. Have you tried date_facets to imbue stringstreams? There you can define the format of dates.
Something, like this:
date d(2005,06,25);
date_facet date_output;
Just as a note: this code is likely to crash when the stringstream is destroyed and date_output is deleted. You'll want to dynamically allocate these facets as shown in the date-time docs.
stringstream ss; ss.imbue( locale(ss.getloc(), &date_output) );
date_output.format("%Y-%B-%d");
ss << d;
string strDate = ss.str();
Is it what you are asking for?
The formats, the strings used for things like month and day names -- basically anything can be replacecd using the facets as Christian indicates. There is an I/O tutorial in the documents that shows how to do this. Good places to read: http://www.boost.org/doc/html/date_time/date_time_io.html#date_time.io_tutor... http://www.boost.org/doc/html/date_time/date_time_io.html HTH, Jeff