다음을 통해 공유


time_get::date_order

Returns the date order used by a facet.

dateorder date_order( ) const;

Return Value

The date order used by a facet.

Remarks

The member function returns do_date_order.

Example

// time_get_date_order.cpp
// compile with: /EHsc
#include <locale>
#include <iostream>
#include <sstream>
#include <time.h>
using namespace std;
void po( char *p )
{
   locale loc( p );

   time_get <char>::dateorder order = use_facet <time_get <char> >( loc ).date_order ( );
   cout << loc.name( );
   switch (order){
      case time_base::dmy: cout << "(day, month, year)" << endl;
      break;
      case time_base::mdy: cout << "(month, day, year)" << endl;
      break;
      case time_base::ydm: cout << "(year, day, month)" << endl;
      break;
      case time_base::ymd: cout << "(year, month, day)"<< endl;
      break;
      case time_base::no_order: cout << "(no_order)"<< endl;
      break;
   }
}

int main( )
{
   po( "C" );
   po( "german" );
   po( "English_Britain" );
}
C(month, day, year)
German_Germany.1252(day, month, year)
English_United Kingdom.1252(day, month, year)

Requirements

Header: <locale>

Namespace: std

See Also

Reference

time_get Class