#include <iostream>
#include <locale>
#include <cstring>
#include <ctime>
using namespace std;
int main()
{
// Obtain the current system time.
time_t t = time(NULL);
tm *cur_time = localtime(&t);
// Create US and German locales.
locale usloc("English_US");
locale gloc("German_Germany");
// Set the locale to US and get the time_put facet for US.
cout.imbue(usloc);
const time_put<char> &us_time = use_facet<time_put<char> >(cout.getloc());
return 0;
}
|