8 #define NUM_OF_LOCALES 3
14 wchar_t buf[BUF_SIZE];
16 time_t time_list[NUM_OF_DATES] = {
17 500, 68200000, 694223999,
18 694224000, 704900000, 705000000,
21 char *locale_list[NUM_OF_LOCALES] = {
26 int result = 0, ddd, lll;
29 for (lll = 0; lll < NUM_OF_LOCALES; lll++) {
30 printf ("\nUsing locale: %s\n", locale_list[lll]);
31 char* set = setlocale(LC_ALL, locale_list[lll]);
33 printf ("FAILED!\n\n");
37 for (ddd = 0; ddd < NUM_OF_DATES; ddd++) {
38 tp = localtime(&time_list[ddd]);
39 printf ("%ld corresponds to ", time_list[ddd]);
41 n = wcsftime (buf, sizeof (buf) / sizeof (buf[0]),
42 L"%H:%M:%S %Y-%m-%d%n", tp);
50 wcsftime (buf, sizeof (buf) / sizeof (buf[0]),
51 L"%tor, as %%D %%T: %D %T%n", tp);
54 wcsftime (buf, sizeof (buf) / sizeof (buf[0]), L"%A (%a)%n", tp);
55 printf ("The weekday was %ls", buf);
57 wcsftime (buf, sizeof (buf) / sizeof (buf[0]), L"%B (%b) %Y%n", tp);
58 /* glibc bug? forgets aigu from french february février
59 * See s/printf (/wprintf (L/g */
60 //wprintf (L"Month was %ls", buf);
61 printf ("Month was %ls", buf);