time_get::date_order


public member function
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:
valuedate order
no_orderNo specific order, or format contains variable components other than day, month and year.
dmyday, month, year
mdymonth, day, year
ymdyear, month, day
ydmyear, 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:

mdy


See also