public member function
<locale>

std::time_get::date_order

dateorder date_order() const;
Return date order
Returns a value of the enumerated member type dateorder indicating the preferred order of the date components for the date formats composed of day, month and year.

The possible order values are:
dateorder 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

Internally, this function simply calls the virtual protected member do_in, which returns the above value by default.

Parameters

none

Return value

A value of enumerated member type time_base::dateorder indicating the preferred order of date components (see time_base).

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// time_get::date_order example
#include <iostream>       // std::cout
#include <locale>         // std::locale, std::time_get, std::use_facet

int main ()
{
  std::locale loc;
  std::time_get<char>::dateorder order;
  order = std::use_facet<std::time_get<char> >(loc).date_order();
  switch (order) {
    case std::time_get<char>::no_order : std::cout << "no_order"; break;
	case std::time_get<char>::dmy : std::cout << "dmy"; break;
	case std::time_get<char>::mdy : std::cout << "mdy"; break;
	case std::time_get<char>::ymd : std::cout << "ymd"; break;
	case std::time_get<char>::ydm : std::cout << "ydm"; break;
  }
  std::cout << '\n';
  return 0;
}

Possible output:

mdy


Data races

The facet is accessed.

Exception safety

Strong guarantee: No side effects in case an exception is thrown.

See also