Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-03-22 11:18:12


--- In boost_at_y..., Michiel Salters <Michiel.Salters_at_c...> wrote:
> > -----Original Message-----
> > From: George A. Heintzelman [mailto:georgeh_at_a...]
> > Subject: Re: [boost] Re: Date/Time Classes
>
> [SNIP]
>
> > For example:
> > using boost::date_format;
> > is >> date_format("mm/dd/yyyy") >> date; // "04/22/2023";
> > is >> date_format("dow, dd mon, yyyy") >> date; // "TUE, 22
> > APR, 2023";
> > George Heintzelman
> > georgeh_at_a...
>
> I'd think you'd want
> is >> date_format("enUS", "%dow, %dd %mon, %yyyy") >> date
> to force a %dow representation. The % makes clear which part of
> the string should be replaced, a la printf().
>
> This would have the big advantage that it's impossible to write
> non-localized
> code; code which assumes a US locale will have to state so
explicitly.
> (Down with the "C" locale ! :)

One would assume that the locale would come from the iostream (via
standard embue() and std::locale types). It would also be beneficial
if the date_format() type used standard strftime formatting codes
(possibly extended).

Bill Kempf


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk