home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / unixlib36d / test / c / strftime < prev    next >
Encoding:
Text File  |  1994-03-08  |  356 b   |  21 lines

  1. #include <stdio.h>
  2. #include <time.h>
  3.  
  4. int
  5. main (void)
  6. {
  7.   char buf[100];
  8.   time_t t;
  9.  
  10.   t = time (NULL);
  11.   printf ("strftime returned %d\n",
  12.       strftime (buf, 1, "%d01234567890123456789",
  13.             gmtime (&t)));
  14.   puts (buf);
  15.   printf ("strftime returned %d\n",
  16.       strftime (buf, 99, "%d01234567890123456789",
  17.             gmtime (&t)));
  18.   puts (buf);
  19.   return 0;
  20. }
  21.