A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.com/reference/locale/time_get/date_order/ below:

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 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
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:


Data races The facet is accessed.

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

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 and date (public member function)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4