From 0ae8d68e641b7ae53600c940597b0e0b534e612f Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Sat, 29 Jan 2005 17:48:07 +0000 Subject: [PATCH] - We also test the strftime() %U, %W and %j format specifiers. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14814 87f5fb63-7c3d-0410-a384-fd976d0f7a62 --- test_programs/test.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test_programs/test.c b/test_programs/test.c index 0bd368e..a9547cc 100644 --- a/test_programs/test.c +++ b/test_programs/test.c @@ -1,5 +1,5 @@ /* - * $Id: test.c,v 1.2 2005-01-25 11:21:58 obarthel Exp $ + * $Id: test.c,v 1.3 2005-01-29 17:48:07 obarthel Exp $ * * :ts=4 */ @@ -102,10 +102,15 @@ main(int argc,char ** argv) strftime(time_buffer,sizeof(time_buffer),"%c",&tm); printf("2005-01-25 12:03:53 -> local time = %s\n",time_buffer); + time(&now); tm = (*gmtime(&now)); strftime(time_buffer,sizeof(time_buffer),"%c",&tm); printf("2005-01-25 12:03:53 -> gmt = %s\n",time_buffer); + tm = (*gmtime(&now)); + strftime(time_buffer,sizeof(time_buffer),"%c %U %W %j",&tm); + printf("%s\n",time_buffer); + #if defined(IEEE_FLOATING_POINT_SUPPORT) || defined(M68881_FLOATING_POINT_SUPPORT) { const double pi = 3.14159265358979323846;