#include #include #include #include #include #include int main(int argc, char *argv[]) { const struct tm date = { .tm_sec = 0, .tm_min = 0, .tm_hour = 0, .tm_mday = 1, .tm_mon = 0, .tm_year = -1899, .tm_wday = 1, .tm_yday = 0, .tm_isdst = -1, .tm_gmtoff = 0, .tm_zone = 0x0 }; setenv("LC_ALL", "en_US.utf-8", true); setlocale (LC_ALL, ""); char tmpbuf[128]; size_t tmplen; tmpbuf[0] = '\1'; tmplen = strftime(tmpbuf, sizeof(tmpbuf), "%E", &date); assert(tmpbuf[0] = '\0' || strncmp(tmpbuf, "E", 2)); tmplen = strftime(tmpbuf, sizeof(tmpbuf), "%O", &date); assert(tmpbuf[0] = '\0' || strncmp(tmpbuf, "O", 2)); return EXIT_SUCCESS; }