]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/samples/date/date.c
ICU-461.12.tar.gz
[apple/icu.git] / icuSources / samples / date / date.c
index 8a7ebe1f964077f0679a4ecad8bc5dffbb1ea018..1312a9ccb156ee70b6b54e4212a9d51a671d22c5 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-*   Copyright (C) 1998-2007, International Business Machines
+*   Copyright (C) 1998-2008, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 **********************************************************************
 *
@@ -160,9 +160,31 @@ usage()
 static void
 version()
 {
-  printf("icudate version %s (ICU version %s), created by Stephen F. Booth.\n", 
-        DATE_VERSION, U_ICU_VERSION);
+  UErrorCode status = U_ZERO_ERROR;
+  const char *tzVer;
+  int len = 256;
+  UChar tzName[256];
+  printf("icudate version %s, created by Stephen F. Booth.\n", 
+        DATE_VERSION);
   puts(U_COPYRIGHT_STRING);
+  tzVer = ucal_getTZDataVersion(&status);
+  if(U_FAILURE(status)) {  
+      tzVer = u_errorName(status);  
+  }
+  printf("\n");
+  printf("ICU Version:               %s\n", U_ICU_VERSION);
+  printf("ICU Data (major+min):      %s\n", U_ICUDATA_NAME);
+  printf("Default Locale:            %s\n", uloc_getDefault());
+  printf("Time Zone Data Version:    %s\n", tzVer);
+  printf("Default Time Zone:         ");
+  status = U_ZERO_ERROR;
+  u_init(&status);
+  len = ucal_getDefaultTimeZone(tzName, len, &status);
+  if(U_FAILURE(status)) {
+    printf(" ** Error getting default zone: %s\n", u_errorName(status));
+  }
+  uprint(tzName, stdout, &status);
+  printf("\n\n");
 }
 
 /* Format the date */