/
githubmirror
/
glibc
Обзор
Документация
Войти
/
githubmirror
/
glibc
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
time/tst_wcsftime.c
28 строк
471 B
Zack Weinberg
Don't use the argument to time.
21 авг 2019, 15:26
Не верифицирован
21 авг 2019, 15:26
1baae4a
Код
Авторство
О чём код?
#include <time.h> #include <wchar.h> int main (int argc, char *argv[]) { wchar_t buf[200]; time_t t; struct tm *tp; int result = 0; size_t n; t = time (NULL); tp = gmtime (&t); n = wcsftime (buf, sizeof (buf) / sizeof (buf[0]), L"%H:%M:%S %Y-%m-%d\n", tp); if (n != 21) result = 1; wprintf (L"It is now %ls", buf); wcsftime (buf, sizeof (buf) / sizeof (buf[0]), L"%A\n", tp); wprintf (L"The weekday is %ls", buf); return result; }