ctime.c 377 B

1234567891011121314151617181920212223242526
  1. #include <time.h>
  2. #include <sys/time.h>
  3. extern void __tm_conv();
  4. extern void __asctime();
  5. char *ctime(timep)
  6. __const time_t *timep;
  7. {
  8. static char cbuf[26];
  9. struct tm tmb;
  10. struct timezone tz;
  11. time_t offt;
  12. gettimeofday((void *) 0, &tz);
  13. offt = -tz.tz_minuteswest * 60L;
  14. /* tmb.tm_isdst = ? */
  15. __tm_conv(&tmb, timep, offt);
  16. __asctime(cbuf, &tmb);
  17. return cbuf;
  18. }