Tools.h++ Manual

6-4 104011 Tandem Computers Incorporated
6
1. A “snapshot” is taken of locale "
fr
". This assumes that your system
supports this locale. Another common name for this locale is "
fr_FR
".
2. A date is constructed using the constructor
RWDate(unsigned day,
const char* month,
unsigned year,
const RWLocale& locale = RWLocale::global());
Note – the second argument "
month
" is meaningful only within the context of
a locale. In this case, we are using the locale constructed at line 1. The result
is the date (as known in English) of June 10, 1990.
3. Here we attempt to construct the same date using the default locale, an
instance of class
RWLocaleDefault
. This locale recognizes US formatting
conventions only. Hence, the date 10 Juin 1990 is meaningless.
4. For the same reason, constructing a date using US names, but with a French
locale, also fails.
5. The date constructed at line 2 is printed using the default locale, i.e., US
formatting conventions. The results are:
June 10, 1990
6. The date is converted to a string, then printed. Again, the default locale is
used. The results are the same:
June 10, 1990
7. The date is converted to a string, this time using the locale constructed at
line 1. The results are now
1
:
10 Juin 1990
1. Your system’s locale files determine the format used.