source: vendor/glibc-tests/2005-06-14/time/tst_wcsftime.c

Last change on this file was 2036, checked in by bird, 20 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 465 bytes
Line 
1#include <time.h>
2#include <wchar.h>
3
4int
5main (int argc, char *argv[])
6{
7 wchar_t buf[200];
8 time_t t;
9 struct tm *tp;
10 int result = 0;
11 size_t n;
12
13 time (&t);
14 tp = gmtime (&t);
15
16 n = wcsftime (buf, sizeof (buf) / sizeof (buf[0]),
17 L"%H:%M:%S %Y-%m-%d\n", tp);
18 if (n != 21)
19 result = 1;
20
21 wprintf (L"It is now %ls", buf);
22
23 wcsftime (buf, sizeof (buf) / sizeof (buf[0]), L"%A\n", tp);
24
25 wprintf (L"The weekday is %ls", buf);
26
27 return result;
28}
Note: See TracBrowser for help on using the repository browser.