1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- Added the "date_test" program.

git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15019 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2005-08-26 12:21:51 +00:00
parent eb10d40332
commit 5acfef419b
5 changed files with 46 additions and 11 deletions

22
test_programs/date_test.c Executable file
View File

@ -0,0 +1,22 @@
#include <time.h>
#include <stdio.h>
#include <locale.h>
int
main(void)
{
time_t tm;
struct tm *ptr;
char str[60];
setlocale(LC_ALL, "C");
tm = time(NULL);
ptr = localtime(&tm);
strftime(str, sizeof(str), "%x\n", ptr);
printf(str);
return 0;
}