home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / unixlib / !UnixLib / test / c / timetest < prev    next >
Encoding:
Text File  |  1994-03-08  |  362 b   |  25 lines

  1. #include <time.h>
  2. #include <stdio.h>
  3.  
  4. int
  5. main ()
  6. {
  7.   struct tm *t_;
  8.   time_t t;
  9.  
  10.   time (&t);
  11.  
  12.   for (;;)
  13.     {
  14.       printf ("t1 = %x\t", t);
  15.       t_ = localtime (&t);
  16.       fputs (asctime (t_), stdout);
  17.       t = mktime (t_);
  18.       printf ("t2 = %x\t", t);
  19.       t_ = localtime (&t);
  20.       fputs (asctime (t_), stdout);
  21.       t -= 86400;
  22.     }
  23.   return 0;
  24. }
  25.