home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1996 December / CD_shareware_12-96.iso / DOS / Programa / CCDL122.ZIP / CLIBS / TIME / TEST / STRTST.C next >
Encoding:
C/C++ Source or Header  |  1996-07-06  |  848 b   |  44 lines

  1. #include <stdarg.h>
  2. #include <stdlib.h>
  3. #include "..\stdinc\time.h"
  4.  
  5. _LL_GETTIME()
  6. {
  7.     return 0;
  8. }
  9. _LL_TICKS()
  10. {
  11.     return 0;
  12. }
  13. void main(void)
  14. {
  15.     struct tm a;
  16.     int i;
  17.     char buf[1000];
  18.     a.tm_sec = 5;
  19.     a.tm_min = 39;
  20.     a.tm_hour = 13;
  21.     a.tm_mday = 28;
  22.     a.tm_mon = 1;
  23.     a.tm_year = 107;
  24.     a.tm_wday = 3;
  25.     a.tm_yday = 59;
  26.     a.tm_isdst = 0;
  27.     printf("%s\n",ASCTIME(&a));
  28.     a.tm_sec = 5;
  29.     a.tm_min = 39;
  30.     a.tm_hour = 0;
  31.     a.tm_mday = 1;
  32.     a.tm_mon = 2;
  33.     a.tm_year = 107;
  34.     a.tm_wday = 3;
  35.     a.tm_yday = 59;
  36.     a.tm_isdst = 1;
  37.     printf("%s\n",ASCTIME(&a));
  38.     i = STRFTIME(buf,1000,"%a %b %c\n",&a);
  39.     printf("%d %s\n",i,buf);
  40.     i = STRFTIME(buf,10,"%a %b %c\n",&a);
  41.     printf("%d %s\n",i,buf);
  42.     i = STRFTIME(buf,1000,"\x22%a %A %b %B '%c' %d %H %i %j %m %M %P %S %U %w %W '%x' '%X' %y %Y %z %%\042\n",&a);
  43.     printf("%d %s\n",i,buf);
  44. }