time_get::date_order
返回 (IDE) 使用日期的顺序。
dateorder date_order( ) const;
返回值
(IDE) 使用日期的顺序。
备注
成员函数返回。do_date_order
示例
// 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" );
}
要求
页眉: <区域设置>
命名空间: std