ctime.c 355 B

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