public member function
std::time_get::date_order
<locale>
dateorder date_order() const;
Return date order
Returns a value of enumerated member type
dateorder indicating the preferred order of date components: day, month and year.
The possible order values are:
| value | date order |
| no_order | No specific order, or format contains variable components other than day, month and year. |
| dmy | day, month, year |
| mdy | month, day, year |
| ymd | year, month, day |
| ydm | year, day, month |
During its operation, the version of this function in the generic template simply calls the virtual protected member
do_date_order, which is the member function in charge of performing the actions described above.
Parameters
none
Return value
A value of enumerated member type
dateorder indicating the preferred order of date components (see
time_get::dateorder).
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
// time_get::date_order example
#include <iostream>
#include <locale>
using namespace std;
int main ()
{
typedef time_get<char> tg;
locale loc;
time_get<char>::dateorder order;
order = use_facet<time_get<char> >(loc).date_order();
switch (order) {
case time_get<char>::no_order : cout << "no_order"; break;
case time_get<char>::dmy : cout << "dmy"; break;
case time_get<char>::mdy : cout << "mdy"; break;
case time_get<char>::ymd : cout << "ymd"; break;
case time_get<char>::ydm : cout << "ydm"; break;
}
cout << endl;
return 0;
}
|
Possible output:
See also
- time_get::get_date
- Read date (public member function)
- time_get::get_monthname
- Read month name (public member function)
- time_get::get_year
- Read year (public member function)
- time_put::put
- Write time (public member function)