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;
}
| |