
On Mon, 27 Feb 2006 16:43:45 +0200, Yuval Ronen wrote
Jeff Garland wrote:
On Sun, 26 Feb 2006 00:50:04 +0200, Yuval Ronen wrote
Hi. I've used the date_time I/O using facets and found it too complicated. The thing that bothers me is that I need to use a facet to specify the format string (e.g "HH:MM:SS"). This is burdensome. IMO, using facets is fine for defining things which are really locale-related (and are mostly constant during the process lifetime) such as the month names in the local language.
Of course the order of dates *is* locale related. Even in the current standard library there is information in date facet about ordering.
I think the date order is a borderline case. In theory, yes, the order is locale-related and the date_facet can have methods like:
void set_dmy_order(); void set_mdy_order();
In practice, however, when specifying the date format ("%Y-%m-%d", for example), this overrides the former order settings, so these settings don't have much (any?) useful usages.
Right. These methods are really used to support input formatting. My proposal calls for both input and output to be format based as it is currently in boost date-time.
P.S: On your other post, you say that you might need to remove the facets for a whole different reason. If this happens, then you can ignore all this...
No, I think you extrapolated my comment too far. I wasn't saying that the facets would be removed -- just augmented with manipulators so you didn't have to resort to facet changes just to change the format string. The facet still needs to be there to set the default ordering and other properties. It would remain the only way to replace the character strings associated with month and week names... Jeff